Subject | Concurrency problem |
---|---|
Author | Lester Caine |
Post date | 2005-08-25T14:09:57Z |
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 ?
Anybody got any ideas - suggestions?
Apache2 - PHP5.0.4 - Firebird 1.5.2 and latest ADOdb ( but direct
ibase_x gives the same problem )
--
Lester Caine
-----------------------------
L.S.Caine Electronic Services
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 ?
Anybody got any ideas - suggestions?
Apache2 - PHP5.0.4 - Firebird 1.5.2 and latest ADOdb ( but direct
ibase_x gives the same problem )
--
Lester Caine
-----------------------------
L.S.Caine Electronic Services