Subject Re: [firebird-support] Re: Is some API to get generator value?
Author Ann Harrison
On Tue, Apr 12, 2011 at 2:42 AM, karolbieniaszewski
<liviuslivius@...> wrote:
>
>
>> As far as I know, generators are used to get primary keys values for new
>> rows. Inserting a row requires a transaction, so you will need it anyway.
>>
>> Are there real situations when you might need to know a generator value
>> without using it in a transaction?
>>
>
> Generator can be used for some other conditions
> 1. as database settings

I don't know what your suggesting here. What sort of a database setting would
use a generated value?

> 2. as replacement for events - you can inc generator value in some conditions eg. some client interest tables are modified.
> Client read in some interval generator value if is different then previous then data should be refreshed

That might be an idea, but the problem with it is not the cost of
starting a transaction to get the
generator value. The benefit of events is that the clients are not
constantly polling the database.
You're trying to reintroduce polling, at a slightly lower cost.

Best regards,

Ann