Subject | Re: [firebird-php] Concurrency problem |
---|---|
Author | Lester Caine |
Post date | 2005-08-25T15:34:08Z |
Jochem Maas wrote:
I'm so used to COMMITTED being the default with IBO ...
--
Lester Caine
-----------------------------
L.S.Caine Electronic Services
> Lester Caine wrote:THAT is the kick I needed ;)
>
>>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
I'm so used to COMMITTED being the default with IBO ...
--
Lester Caine
-----------------------------
L.S.Caine Electronic Services