You configure the amount of time a transaction waits before Derby does any deadlock checking with the derby.locks.deadlockTimeout property.
You configure the amount of time a transaction waits before timing out with the derby.locks.waitTimeout property. When configuring your database or system, you should consider these properties together. For example, in order for any deadlock checking to occur, the derby.locks.deadlockTimeout property must be set to a value lower than the derby.locks.waitTimeout property. If it is set to a value equal to or higher than the derby.locks.waitTimeout, the transaction times out before Derby does any deadlock checking.
By default, derby.locks.waitTimeout is set to 60 seconds. -1 is the equivalent of no wait timeout. This means that transactions never time out, although Derby can choose a transaction as a deadlock victim.
In the following figure, derby.locks.deadlockTimeout is set to 30 seconds, while derby.locks.waitTimeout has no limit.
In the following figure, derby.locks.deadlockTimeout is set to 60 seconds, while derby.locks.waitTimeout is set to 90 seconds.
In the following figure, derby.locks.deadlockTimeout is set to 60 seconds, while derby.locks.waitTimeout is set to 50 seconds, lower than the deadlock timeout limit.