On 5/13/2011 3:46 PM, Dag H. Wanvik wrote:
Hi,

In general, this resource may help you understand how Derby uses locks:

http://db.apache.org/derby/docs/10.8/devguide/cdevconcepts30291.html

and specifically how to debug deadlocks:

http://db.apache.org/derby/docs/10.8/devguide/cdevconcepts50894.html
http://wiki.apache.org/db-derby/LockDebugging

If you feel you understand how Derby takes locks but are seeing Derby
take locks that you feel are not appropriate for your usage and
isolation level, please let us know. If you can provide a lock table
dump, that would be helpful. Please state version of Derby are you
using, too.

If you are using the new 10.8.1.2 release, setting derby.stream.error.extendedDiagSeverityLevel=30000
will print the stack traces of all active threads on deadlock to derby.log, which can help debug both application and possible Derby  issues with Deadlocks.

http://db.apache.org/derby/docs/10.8/ref/rrefproperextdiagsevlevel.html