Subject | Re: [firebird-support] Getting a unique value from a generator |
---|---|
Author | Ann W. Harrison |
Post date | 2005-05-13T18:31:39Z |
Jason Dodson wrote:
row. Yes, it's somewhat unpredictable which transaction will get the
lock, but some transaction will get it. Until that transaction ends, no
other transaction can modify that record - depending on the transaction
type others will get an immediate error or wait for the transaction that
did the update to finish.
Using a generator - or any non-transactional method of locking - can
cause problems when a transaction fails.
Regards,
Ann
> Or how about rather then calling GEN_ID directly in your code, use aI don't think so. A control table requires a single update to a single
> Business rule saying you need to use stored procedure GetMyNextID()
> which will consistantly increment the ID.
>
> Using a control table is nothing but trouble. You fight race conditions
> at that point.
row. Yes, it's somewhat unpredictable which transaction will get the
lock, but some transaction will get it. Until that transaction ends, no
other transaction can modify that record - depending on the transaction
type others will get an immediate error or wait for the transaction that
did the update to finish.
Using a generator - or any non-transactional method of locking - can
cause problems when a transaction fails.
Regards,
Ann