# Uses of Class
org.springframework.dao.DataAccessException

Packages that use DataAccessException
Package
Description
org.springframework.dao
Exception hierarchy enabling sophisticated error handling independent of the data access approach in use.
org.springframework.dao.support
Support classes for DAO implementations, providing miscellaneous utility methods.

## Uses of DataAccessException in org.springframework.dao

Subclasses of DataAccessException in org.springframework.dao
Modifier and Type
Class
Description
`class`
`CannotAcquireLockException`
Exception thrown on failure to acquire a lock during an update, for example during a "select for update" statement.
`class`
`CannotSerializeTransactionException`
Deprecated.
as of 6.0.3, in favor of `PessimisticLockingFailureException`/`CannotAcquireLockException`
`class`
`CleanupFailureDataAccessException`
Deprecated.
as of 6.0.3 since it is not in use within core JDBC/ORM support
`class`
`ConcurrencyFailureException`
Exception thrown on various data access concurrency failures.
`class`
`DataAccessResourceFailureException`
Data access exception thrown when a resource fails completely: for example, if we can't connect to a database using JDBC.
`class`
`DataIntegrityViolationException`
Exception thrown when an attempt to execute an SQL statement fails to map the given data, typically but no limited to an insert or update data results in violation of an integrity constraint.
`class`
`DataRetrievalFailureException`
Exception thrown if certain expected data could not be retrieved, for example, when looking up specific data via a known identifier.
`class`
`DeadlockLoserDataAccessException`
Deprecated.
as of 6.0.3, in favor of `PessimisticLockingFailureException`/`CannotAcquireLockException`
`class`
`DuplicateKeyException`
Exception thrown when an attempt to insert or update data results in violation of a primary key or unique constraint.
`class`
`EmptyResultDataAccessException`
Data access exception thrown when a result was expected to have at least one row (or element) but zero rows (or elements) were actually returned.
`class`
`IncorrectResultSizeDataAccessException`
Data access exception thrown when a result was not of the expected size, for example when expecting a single row but getting 0 or more than 1 rows.
`class`
`IncorrectUpdateSemanticsDataAccessException`
Data access exception thrown when something unintended appears to have happened with an update, but the transaction hasn't already been rolled back.
`class`
`InvalidDataAccessApiUsageException`
Exception thrown on incorrect usage of the API, such as failing to "compile" a query object that needed compilation before execution.
`class`
`InvalidDataAccessResourceUsageException`
Root for exceptions thrown when we use a data access resource incorrectly.
`class`
`NonTransientDataAccessException`
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.
`class`
`NonTransientDataAccessResourceException`
Data access exception thrown when a resource fails completely and the failure is permanent.
`class`
`OptimisticLockingFailureException`
Exception thrown on an optimistic locking violation.
`class`
`PermissionDeniedDataAccessException`
Exception thrown when the underlying resource denied a permission to access a specific element, such as a specific database table.
`class`
`PessimisticLockingFailureException`
Exception thrown on a pessimistic locking violation.
`class`
`QueryTimeoutException`
Exception to be thrown on a query timeout.
`class`
`RecoverableDataAccessException`
Data access exception thrown when a previously failed operation might be able to succeed if the application performs some recovery steps and retries the entire transaction or in the case of a distributed transaction, the transaction branch.
`class`
`TransientDataAccessException`
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.
`class`
`TransientDataAccessResourceException`
Data access exception thrown when a resource fails temporarily and the operation can be retried.
`class`
`TypeMismatchDataAccessException`
Exception thrown on mismatch between Java type and database type: for example on an attempt to set an object of the wrong type in an RDBMS column.
`class`
`UncategorizedDataAccessException`
Normal superclass when we can't distinguish anything more specific than "something went wrong with the underlying resource": for example, an SQLException from JDBC we can't pinpoint more precisely.

## Uses of DataAccessException in org.springframework.dao.support

Methods in org.springframework.dao.support that return DataAccessException
Modifier and Type
Method
Description
`DataAccessException`
ChainedPersistenceExceptionTranslator.`translateExceptionIfPossible(RuntimeException ex)`
`DataAccessException`
PersistenceExceptionTranslator.`translateExceptionIfPossible(RuntimeException ex)`
Translate the given runtime exception thrown by a persistence framework to a corresponding exception from Spring's generic `DataAccessException` hierarchy, if possible.