- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
OptimisticLockException
The database failures of this type are the ones on which the database gave up the transaction's work because another transaction conflicted with it; the dialect classifies them from the error the database reports, whether a statement reports it or the commit does, as a database that detects a serialization conflict only when the transaction commits reports it. A failure after which the outcome of the transaction is unknown, a lost connection, including one lost during the commit, is not of this type, and neither is a lock wait timeout, which some databases answer by rolling back only the statement.
Rerun the transaction, never the statement alone: the transaction the failure occurred in cannot commit the work it did. A rerun repeats every side effect of the transactional block, so an effect outside the database belongs in a commit callback.
- Since:
- 1.16
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs a newTransientPersistenceExceptionexception withnullas its detail message.TransientPersistenceException(String message) Constructs a newTransientPersistenceExceptionexception with the specified detail message.TransientPersistenceException(String message, Throwable cause) Constructs a newTransientPersistenceExceptionexception with the specified detail message and cause.Constructs a newTransientPersistenceExceptionexception with the specified cause. -
Method Summary
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
TransientPersistenceException
public TransientPersistenceException()Constructs a newTransientPersistenceExceptionexception withnullas its detail message. -
TransientPersistenceException
Constructs a newTransientPersistenceExceptionexception with the specified detail message.- Parameters:
message- the detail message.
-
TransientPersistenceException
Constructs a newTransientPersistenceExceptionexception with the specified detail message and cause.- Parameters:
message- the detail message.cause- the cause.
-
TransientPersistenceException
Constructs a newTransientPersistenceExceptionexception with the specified cause.- Parameters:
cause- the cause.
-