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.
>
And I am still confused that a function should behave differently (start a transaction or not) depending on whether the return value is assigned to a variable or not - but this is what I see.

Regards
Emil