Subject Re: [firebird-support] Getting a unique value from a generator
Author Hans
I ment it one a table with just one record, providing a simple
solution to his multi station access control. Together with
CURRENT_CONNECTION and a user table, you can
find out who is doing what when locked. Upon loosing
a connection the lock automatically gets cleared.

----- Original Message -----
From: "Ann W. Harrison" <aharrison@...>
To: <firebird-support@yahoogroups.com>
Sent: Friday, May 13, 2005 12:18 PM
Subject: Re: [firebird-support] Getting a unique value from a generator


> 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
>
>
>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
> Visit http://firebird.sourceforge.net and click the Resources item
> on the main (top) menu. Try Knowledgebase and FAQ links !
>
> Also search the knowledgebases at http://www.ibphoenix.com
>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
> Yahoo! Groups Links
>
>
>
>
>
>