Greetings!
I'm having a situation when my customers need an order number which is based on a generator, sometimes the order number they get has already been used.
Is there a sure-fire way/procedure to make sure of getting an absolute unique order number? I thought generators work outside the transaction but apparently not?
I'm using, Delphi 6, IBDAC latest version and Firebird 1.56.
Thanks for any help!
Kevin
Getting an absolute generator value
-
kstantonnw
- Posts: 13
- Joined: Mon 25 Feb 2008 17:22
- Location: Oregon
-
AndreyZ
Hello,
Generators are transaction-independent. You can find more information about it here (in the "Generators and transactions" section): http://www.firebirdsql.org/manual/gener ... asics.html . As you can see from this article, there is the possibility to obtain the same value from a generator that was already used. You can call the gen_id function with negative or zero increment that may return a value that was already used. To avoid such problems using IBDAC, you must not set the TCustomIBCDataSet.GeneratorStep property to zero or negative values (unless you are absolutely sure about what you are doing).
Generators are transaction-independent. You can find more information about it here (in the "Generators and transactions" section): http://www.firebirdsql.org/manual/gener ... asics.html . As you can see from this article, there is the possibility to obtain the same value from a generator that was already used. You can call the gen_id function with negative or zero increment that may return a value that was already used. To avoid such problems using IBDAC, you must not set the TCustomIBCDataSet.GeneratorStep property to zero or negative values (unless you are absolutely sure about what you are doing).