Derby provides a tool to monitor and display locking information.
This tool can help you create applications that minimize deadlock. It can also help you locate the cause of deadlock when it does occur.
To diagnose locking problems, constantly monitor locking traffic by logging all deadlocks by using the derby.locks.monitor property, which is described in the Derby Reference Manual.