Subject Re: [firebird-support] SELECT WITH LOCK, WAIT transaction, deadlock
Author Gabor Boros
2016. 04. 28. 21:22 keltezéssel, Ann Harrison aharrison@...
[firebird-support] írta:
> Okay... What's the requirement that keeps you from using generators?

I need number generators which give back sequence numbers without
skipping and repeating. But don't know how many needed. The number of
needed generators depend on the customers(X Ltd., Y Ltd, ...). This is
why I want to store the generators in a table.

> Do you intend to grab the number in a transaction that does other work?

The transaction do other work before grab the number and after grab the
number. The whole thing is in a (one) stored procedure. (Works like a
charm except deadlocks.)

> What is the concurrency requirement?

If I understand your question correctly... I don't think will be high
load but I test is because not want to see deadlock in production.

> What you're thinking about doing
> will serialize the generation of identifiers and all other actions of
> those transactions. I'm not totally convinced that using
> ReadCommitted/wait will create an auditable series of numbers in the
> case where a transaction fails.

For testing purposes the test app insert the generated numbers into a
one field table which have a unique constraint. I not see any error
except the deadlocks.