Class DeadlockException
- All Implemented Interfaces:
Serializable
Thrown when a lock request by a transaction timed out due to a
deadlock, or a trivial deadlock was quickly detected. Deadlocks can be prevented by locking
records in a consistent order. Cases of "self deadlock" when using multiple transactions in
one thread are not detected, and a regular timeout exception is thrown instead.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionDeadlockException(long nanosTimeout) DeadlockException(long nanosTimeout, Object attachment, boolean guilty) DeadlockException(long nanosTimeout, Object attachment, boolean guilty, Set<DeadlockInfo> set) -
Method Summary
Methods inherited from class LockTimeoutException
ownerAttachment, timeout, timeoutNanos, unitMethods inherited from class LockFailureException
isRecoverableModifier and TypeMethodDescriptionbooleanReturns false if database should be closed as a result of this exception.Methods inherited from class Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
DeadlockException
public DeadlockException(long nanosTimeout) - Parameters:
nanosTimeout- negative is interpreted as infinite wait
-
DeadlockException
- Parameters:
nanosTimeout- negative is interpreted as infinite wait
-
DeadlockException
public DeadlockException(long nanosTimeout, Object attachment, boolean guilty, Set<DeadlockInfo> set) - Parameters:
nanosTimeout- negative is interpreted as infinite wait
-
-
Method Details
-
isGuilty
public boolean isGuilty()- Returns:
- true if caller helped caused the deadlock; false if caller might be innocent
-
deadlockSet
- Returns:
- the set of lock requests which were in a deadlock
-
getMessage
- Overrides:
getMessagein classLockTimeoutException
-
shortMessage
- Returns:
- message without deadlock set info
-