Fwd: Auto generation of database keys

2005-06-13 Thread Craig Russell
Hi,I'm running into a locking issue when using generated keys. My primary key column is defined asĀ DATASTORE_IDENTITY BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY. I don't care about the key being transactional. That is, if a transaction rolls back, I can live with the key that was allocated being

Re: Fwd: Auto generation of database keys

2005-06-14 Thread Satheesh Bandaram
I thought Derby uses nested user transaction to commit generated identity values, to avoid holding locks. See getSetAutoincrementValue() inĀ  org/apache/derby/impl/sql/execute/InsertResultSet.java. I tried the following using IJ, using default isolation levels. I couldn't see the problem. Sathe

Re: Fwd: Auto generation of database keys

2005-06-14 Thread Mike Matrigali
I have not been able to reproduce this issue. Derby uses nested internal transactions when updating the IDENTITY column, it does not try to guarantee that a value won't be lost. These locks should not be held until end of user transaction, they are committed separate from the user transaction, so

Re: Fwd: Auto generation of database keys

2005-06-14 Thread Sunitha Kambhampati
To help debug this, try setting both derby.locks.monitor=true and derby.locks.deadlockTrace=true . This will print the lock table dump when the timeout or deadlock happens to derby.log. The lock table will give information on what locks are being held etc.. Sunitha. Mike Matrigali wrote:

Re: Fwd: Auto generation of database keys

2005-06-14 Thread Mike Matrigali
I have not been able to reproduce this issue. Derby uses nested internal transactions when updating the IDENTITY column, it does not try to guarantee that a value won't be lost. These locks should not be held until end of user transaction, they are committed separate from the user transaction, so