Subject | Re: [firebird-php] transactions .... I thought I got it, little did I know. |
---|---|
Author | Jochem Maas |
Post date | 2007-10-26T13:25:02Z |
Lester Caine wrote:
around the ibase* functions.
for php5 in the first place (well it was his idea, in reaction to a project
I had suggested to him)
link and the transaction indentifier are passed to the relevant functions (in my
class).
still I would like to know if it should be possible (is some way) to perform
SELECT queries AND INSERT queries within a single transaction and have the SELECT
queries be able to see the changes made by prior INSERT queries that have not yet
been committed, but were performed within the context of the same [active] transaction.
personally I feel like it should be possible (maybe given certain transaction arguments
when the transaction is started) to see uncommitted changes within the confines of the
transaction that made them.
>I have a wrapper class (my own, ard biesheuvel had a hand in writing it too)
>
> Jochem Maas wrote:
>> say I want to perform a number of inserts and treat them as a single
> transaction, no problem.
>>
>> now imagine I need to be able to interlace the inserts with select
> statements and that the select
>> statements need to be able to read inserted records (has to do with
> calculated fields) that
>> have not yet been committed ... is this even possible.
>>
>> i.e.
>>
>> 1. start with an empty table
>> 2. start a transaction
>> 3. insert a record into table
>> 4. read back inserted record
>> 5. determine whether to rollback or commit
>>
>> I can't get this to work at all - personally I think it is odd that
> within a single transaction
>> it is not possible to perform select queries that can see data that
> has been inserted or updated
>> (but not yet commited) within the confines of the same transaction.
>>
>> should this be possible? I am running FB 1.5.x, maybe I need to
> upgrade to FB2?
>>
>> hope someone can shed some light on this or maybe point me at a decent
> (aka understandable) tutorial
>> on using transactions in firebird - I've read pretty much everything I
> kind find ... most of it is like
>> http://php/net/ibase, <http://php/net/ibase,> namely, only very useful
> if you already understand how to use transactions properly.
>
> Are you doing this JUST using ibase calls?
around the ibase* functions.
> PHP5? - PHP4 does not have some of the relevant facilities availableIm using PHP5 ... Im the weirdo that got Ard to rewrite the ibase extension
> they were
> only added in PHP5.
for php5 in the first place (well it was his idea, in reaction to a project
I had suggested to him)
> I have not been having any trouble with this, but I tend to keep the dataI know - actually if there is a transaction identifier 'active' then both the
> local as well until I commit to the database. You do need to be careful
> ensuring you are using the transaction handle rather than the connection
> one
> when accessing within the transaction.
link and the transaction indentifier are passed to the relevant functions (in my
class).
still I would like to know if it should be possible (is some way) to perform
SELECT queries AND INSERT queries within a single transaction and have the SELECT
queries be able to see the changes made by prior INSERT queries that have not yet
been committed, but were performed within the context of the same [active] transaction.
personally I feel like it should be possible (maybe given certain transaction arguments
when the transaction is started) to see uncommitted changes within the confines of the
transaction that made them.