Subject Re: Default transaction
Author ettotev
--- In firebird-php@yahoogroups.com, masotti <masotti@...> wrote:
>
> Hi Emil,
>
> On 16/12/2011 11:45, ettotev wrote:
>
> > ibase_trans (IBASE_READ | IBASE_COMMITTED | IBASE_REC_VERSION);
>
> I've not source at hand now, but this seems reasonably only a request to
> define a PHP resource to be used as a transaction, so, probably, it will
> be started only when actually requested in a command, or assigned to a
> PHP var, as in
>
> > $rotran = ibase_trans (IBASE_READ | IBASE_COMMITTED | IBASE_REC_VERSION);
> > then a new transaction is started with the correct transaction settings,
> > but again if I don't specify the transaction identifier in ibase_query()
> > it executes in a new default transaction with IBASE_DEFAULT.
>
> Seems that you misunderstand documentation: you may need to have two ore
> more distinct type of transaction in the same script, so you need to
> differentiate them, and only the default transaction is unnominated and
> isn't needed in parameters, other must be passed in parameters.
>
OK, this is now more or less clear.
> >
> > Basically this would mean that the transaction settings of the default
> > transaction cannot be changed. Or am I missing something?
>
> You can do that in php.ini or use in very first statements of script
>
> ini_set();
>
What I mean is - could I have a default transaction that is READ ONLY (for example)? I don't see any php.ini parameter related to transactions, and in the "Predefined constants" section there is
IBASE_DEFAULT: The default transaction settings are to be used. This default is determined by the client library, which defines it as IBASE_WRITE|IBASE_CONCURRENCY|IBASE_WAIT in most cases.

Regards
Emil