Hi,
I m executing the following queries in a method in java on derby database.

***************
INSERT INTO some_SCHEMA.some_TABLE (some_fields) VALUES (some_values); /*
This insert has an identity column */

SELECT IDENTITY_VAL_LOCAL() FROM some_schema.some_TABLE;
***************

when there is a lot of load on this method, I'm getting following exception:

Error performing query.;  Caused by:
java.sql.SQLTransactionRollbackException: A lock could not be obtained due
to a deadlock, cycle of locks and waiters is:
Lock : ROW, some_TABLE, (15,6)
  Waiting XID : {23261, S} , APP, SELECT IDENTITY_VAL_LOCAL() FROM
some_SCHEMA.some_TABLE
  Granted XID : {23260, X}

Anyone know what might be the reason and solution to avoid this deadlock?

Thanks in advance.
-- 
View this message in context: 
http://old.nabble.com/Deadlock-problem-tp28287638p28287638.html
Sent from the Apache Derby Developers mailing list archive at Nabble.com.

Reply via email to