Subject Re: [firebird-support] SELECT WITH LOCK, WAIT transaction, deadlock
Author
Great, Thanks!


On Friday, April 29, 2016 10:26 AM, "Gabor Boros gaborboros@... [firebird-support]" <firebird-support@yahoogroups.com> wrote:


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.


Gabor


------------------------------------

------------------------------------

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Visit http://www.firebirdsql.org and click the Documentation item
on the main (top) menu.  Try FAQ and other links from the left-side menu there.

Also search the knowledgebases at http://www.ibphoenix.com/resources/documents/


++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
------------------------------------

Yahoo Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/firebird-support/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/firebird-support/join
    (Yahoo! ID required)

<*> To change settings via email:
    firebird-support-digest@yahoogroups.com
    firebird-support-fullfeatured@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
    firebird-support-unsubscribe@yahoogroups.com

<*> Your use of Yahoo Groups is subject to:
    https://info.yahoo.com/legal/us/yahoo/utos/terms/