Subject Re: [firebird-support] Getting a unique value from a generator
Author Ann W. Harrison
Hans wrote:
> Actually a "select * from table with lock" is the simplest, I think
>
That'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