If deadlocks occur frequently in your multi-user system with a particular application, you might need to do some debugging.
Derby provides a class to help you in this situation, org.apache.derby.diag.LockTable. Access to the LockTable information is provided via the SYSCS_DIAG.LOCK_TABLE diagnostic table.
The SYSCS_DIAG.LOCK_TABLE diagnostic table shows all of the locks that are currently held in the Derby database. You can reference the SYSCS_DIAG.LOCK_TABLE diagnostic table directly in a statement.
SELECT * FROM SYSCS_DIAG.LOCK_TABLE
When the SYSCS_DIAG.LOCK_TABLE diagnostic table is referenced in a statement, a snapshot of the lock table is taken.
Additional general information about diagnosing locking problems can be found in the Derby Wiki at http://wiki.apache.org/db-derby/LockDebugging.