Subject | Re: [firebird-support] Getting a unique value from a generator |
---|---|
Author | Ann W. Harrison |
Post date | 2005-05-13T18:18:53Z |
Hans wrote:
and runs a (very slight) risk of a deadlock if two transactions don't
follow exactly the same path.
The problem with incrementing and decrementing a generator is that if
any transaction fails between its increment and decrement, the generator
is left at a value greater than zero. For what you're doing, you really
need a transaction-based marker that will be corrected automatically if
a transaction fails.
Regards,
Ann
> Actually a "select * from table with lock" is the simplest, I thinkThat's hideously expensive because it modifies every record in the table
>
and runs a (very slight) risk of a deadlock if two transactions don't
follow exactly the same path.
The problem with incrementing and decrementing a generator is that if
any transaction fails between its increment and decrement, the generator
is left at a value greater than zero. For what you're doing, you really
need a transaction-based marker that will be corrected automatically if
a transaction fails.
Regards,
Ann