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
M. Shaker, H. Ibrahim, A. Mustapha, и L. Abdullah. Proceedings of the 11th International Conference on Information Integration and Web-based Applications & Services, стр. 470--476. New York, NY, USA, ACM, (2009)