public static enum DataAccessException.Reason extends Enum<DataAccessException.Reason>
| Enum Constant and Description |
|---|
BadSqlGrammar
Exception thrown when SQL specified is invalid.
|
CannotAcquireLock
Failure to acquire a lock during an update, for example during a "select for update"
statement.
|
CannotSerializeTransaction
Failure to complete a transaction in serialized mode due to update conflicts.
|
ConcurrencyFailure
Indicate the type of failure: optimistic locking, failure to acquire lock, etc.
|
DataAccessResourceFailure
Data access exception thrown when a resource fails completely: for example, if we can't
connect to a database using JDBC.
|
DataIntegrityViolation
Exception thrown when an attempt to insert or update data results in violation of an
integrity constraint.
|
DeadlockLoserDataAccess
Generic exception thrown when the current process was a deadlock loser, and its
transaction rolled back.
|
DuplicateKey
Exception thrown when an attempt to insert or update data results in violation of a
primary key or unique constraint.
|
InvalidDataAccessResourceUsage
Root for exceptions thrown when we use a data access resource incorrectly.
|
InvalidResultSetAccess
Exception thrown when a ResultSet has been accessed in an invalid fashion.
|
NonTransientDataAccess
Root of the hierarchy of data access exceptions that are considered non-transient -
where a retry of the same operation would fail unless the cause of the Exception
is corrected.
|
NonTransientDataAccessResource
Data access exception thrown when a resource fails completely and the failure is
permanent.
|
PermissionDeniedDataAccess
Exception thrown when the underlying resource denied a permission to access a specific
element, such as a specific database table.
|
PessimisticLockingFailure
Exception thrown on a pessimistic locking violation.
|
QueryTimeout
Exception to be thrown on a query timeout.
|
Root
Root reason.
|
TransientDataAcces
Root of the hierarchy of data access exceptions that are considered transient - where a
previously failed operation might be able to succeed when the operation is retried
without any intervention by application-level functionality.
|
TransientDataAccessResource
Exception thrown when the underlying resource denied a permission to access a specific
element, such as a specific database table.
|
UncategorizedDataAccess
Normal superclass when we can't distinguish anything more specific than "something went
wrong with the underlying resource": for example, a SQLException from JDBC we cannot
pinpoint more precisely.
|
UncategorizedSql
Exception thrown when we can't classify a SQLException into one of our generic data
access exceptions.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
isAncestorOf(DataAccessException.Reason reason) |
boolean |
isAncestorOrSelfOf(DataAccessException.Reason reason) |
boolean |
isDescendantOf(DataAccessException.Reason reason) |
boolean |
isDescendantOrSelfOf(DataAccessException.Reason reason) |
static DataAccessException.Reason |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static DataAccessException.Reason[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final DataAccessException.Reason Root
public static final DataAccessException.Reason NonTransientDataAccess
public static final DataAccessException.Reason DataIntegrityViolation
public static final DataAccessException.Reason DuplicateKey
public static final DataAccessException.Reason InvalidDataAccessResourceUsage
public static final DataAccessException.Reason BadSqlGrammar
java.sql.SQLException root cause.
It would be possible to have subclasses for no such table, no such column etc. A custom SQLExceptionTranslator could create such more specific exceptions, without affecting code using this class.
public static final DataAccessException.Reason InvalidResultSetAccess
java.sql.SQLException root cause.
This typically happens when an invalid ResultSet column index or name has been specified. Also thrown by disconnected SqlRowSets.
public static final DataAccessException.Reason NonTransientDataAccessResource
public static final DataAccessException.Reason DataAccessResourceFailure
public static final DataAccessException.Reason PermissionDeniedDataAccess
public static final DataAccessException.Reason UncategorizedDataAccess
public static final DataAccessException.Reason UncategorizedSql
public static final DataAccessException.Reason TransientDataAcces
public static final DataAccessException.Reason ConcurrencyFailure
public static final DataAccessException.Reason PessimisticLockingFailure
public static final DataAccessException.Reason CannotAcquireLock
public static final DataAccessException.Reason CannotSerializeTransaction
public static final DataAccessException.Reason DeadlockLoserDataAccess
public static final DataAccessException.Reason QueryTimeout
This exception can be thrown by user code trapping the native database exception or by exception translation.
public static final DataAccessException.Reason TransientDataAccessResource
public static DataAccessException.Reason[] values()
for (DataAccessException.Reason c : DataAccessException.Reason.values()) System.out.println(c);
public static DataAccessException.Reason valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic boolean isAncestorOf(DataAccessException.Reason reason)
public boolean isAncestorOrSelfOf(DataAccessException.Reason reason)
public boolean isDescendantOf(DataAccessException.Reason reason)
public boolean isDescendantOrSelfOf(DataAccessException.Reason reason)
Copyright © 2019. All rights reserved.