Subject Re: [firebird-support] Is some API to get generator value?
Author Alexandre Benson Smith

Em 12/4/2011 04:54, Kjell Rilbe escreveu:
> Den 2011-03-10 09:37 skrev karolbieniaszewski såhär:
>> is some API to get generator value?
>> or only possible way is
>> select GEN_ID(gen_name, 0) from RDB$Database
>> i ask because this is stupid to start transaction to get non
>> transactional object value
> Since others have replied there is no such API function, perhaps it's
> worth sontemplating what's "cheaper":
> 1. start trans, read generator, commit
> or:
> 2. start trans, read generator, rollback
> Anyone?
> Kjell

AFAIK commit is cheaper than rollback, but I don't think it would be
significant in a such simple construct.

Try it a million times in a loop and tell us :)

see you !