I have a tricky problem with some
JDBC code. I am getting an exception with the message "A lock could not be obtained within the time requested".
My application is very multi-threaded, so I thought I must have some sort of database-related deadlock, where two threads try to lock the same tables in different orders. However, a full
thread dump at time of exception shows that only the failing thread is doing JDBC. All other threads are doing unrelated stuff (mostly just waiting).
The database is JavaDB (a.k.a. Derby).
Any ideas?
Exception occurred: java.sql.SQLTransactionRollbackException (to be caught at: org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(), line=-1 bci=527)"thread=JobLogger0005", org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(), line=-1 bci=526