To debug lock timeout errors, set derby.locks.monitor=true and derby.locks.deadlockTrace=true in derby.properties. This will print the lock table information to the derby.log when the timeout happens. If you also set derby.language.logStatementText=true, then all the statements executed on the system will be written out to the derby.log
K. Imamura, J. Foster, and A. Krings. The Second NASA/DoD workshop on Evolvable Hardware, page 75--80. Palo Alto, California, IEEE Computer Society, (13-15 July 2000)