Subject Re: [firebird-php] Concurrency problem
Author Jochem Maas
Lester Caine wrote:
> I'm having a bit of fun with multiple users on the system, the active
> transaction does not seem to be helping :(
>
> I have a list of tickets to be dealt with and need to call the next one,
> so I have a query that looks at all current records with ROOMS = 81
> (queue no), read the first record and update it's ROOM entry to 1 (room
> number). Read and update wrapped in a transaction. The problem is that
> if two people both hit 'next' at the same time, they both get the same
> ticket number, but the last one processed matches the room number. I
> must be doing something wrong, as I am expecting the second commit to
> fail and then simply 'retry' for the next ticket - I THINK ?

which flags are you using to setup the transaction?

its a gues but I think you need to start the transaction with
the IBASE_COMMITTED flag

the default flags are:

IBASE_WRITE | IBASE_CONCURRENCY | IBASE_WAIT

>
> Anybody got any ideas - suggestions?
>
> Apache2 - PHP5.0.4 - Firebird 1.5.2 and latest ADOdb ( but direct
> ibase_x gives the same problem )
>