Subject RE: [firebird-support] Locking tables or dirty read
Author Alan McDonald
> I have a system where multiple users can select/insert data. At some
> point I have a key that is an integer that gets incremented very
> often. All insertions are in transaction. If user a starts a
> transaction it starts with updating the key, after that is does
> several other inserts. While user a is performing these queries user b
> starts a new transaction, it tries to increment the key and use it
> (that is the old value, because user a didn't commit yet). This gives
> a primary key constraint because the transaction of user a is finished
> during this period.
>
> How can I solve this? Can I lock a table with FB, or is it possible to
> set some dirty read option?
>
> I am using FB1.5 superserver on winXP.
>
> TiA,
>
> Alexander
>

The answer is DON'T increment these keys manually. Use the DB as it was
designed and use generators to create the keys. You'll never have a
conflict.
Grab the documents off www.ibphoenix.com and read all about generators.
Alan