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
J. Triplett, P. McKenney, and J. Walpole. Proceedings of the 2011 USENIX conference on USENIX annual technical conference, page 11. Berkeley, CA, USA, USENIX Association, (2011)
A. Wilson. UIST '05: Proceedings of the 18th annual ACM symposium on User interface software and technology, page 83--92. New York, NY, USA, ACM, (2005)
A. Tengli, Y. Yang, and N. Ma. Proceedings of the 20th international conference on Computational Linguistics, Stroudsburg, PA, USA, Association for Computational Linguistics, (2004)