org.springframework.dao |
Exception hierarchy enabling sophisticated error handling independent
of the data access approach in use. For example, when DAOs and data
access frameworks use the exceptions in this package (and custom
subclasses), calling code can detect and handle common problems such
as deadlocks without being tied to a particular data access strategy,
such as JDBC.
All these exceptions are unchecked, meaning that calling code can
leave them uncaught and treat all data access exceptions as fatal.
The classes in this package are discussed in Chapter 9 of
Expert One-On-One J2EE Design and Development
by Rod Johnson (Wrox, 2002).
|
Java Source File Name | Type | Comment |
CannotAcquireLockException.java | Class | Exception thrown on failure to aquire a lock during an update,
for example during a "select for update" statement. |
CannotSerializeTransactionException.java | Class | Exception thrown on failure to complete a transaction in serialized mode
due to update conflicts. |
CleanupFailureDataAccessException.java | Class | Exception thrown when we couldn't cleanup after a data access operation,
but the actual operation went OK. |
ConcurrencyFailureException.java | Class | Exception thrown on concurrency failure. |
DataAccessException.java | Class | Root of the hierarchy of data access exceptions discussed in
Expert One-On-One J2EE Design and Development.
Please see Chapter 9 of this book for detailed discussion of the
motivation for this package.
This exception hierarchy aims to let user code find and handle the
kind of error encountered without knowing the details of the particular
data access API in use (e.g. |
DataAccessResourceFailureException.java | Class | Data access exception thrown when a resource fails completely:
for example, if we can't connect to a database using JDBC. |
DataIntegrityViolationException.java | Class | Exception thrown when an attempt to insert or update data
results in violation of an integrity constraint. |
DataRetrievalFailureException.java | Class | Exception thrown if certain expected data could not be retrieved, e.g.
when looking up specific data via a known identifier. |
DeadlockLoserDataAccessException.java | Class | Generic exception thrown when the current process was
a deadlock loser, and its transaction rolled back. |
EmptyResultDataAccessException.java | Class | 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. |
IncorrectResultSizeDataAccessException.java | Class | 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. |
IncorrectUpdateSemanticsDataAccessException.java | Class | Data access exception thrown when something unintended appears to have
happened with an update, but the transaction hasn't already been rolled back. |
InvalidDataAccessApiUsageException.java | Class | Exception thrown on incorrect usage of the API, such as failing to
"compile" a query object that needed compilation before execution. |
InvalidDataAccessResourceUsageException.java | Class | Root for exceptions thrown when we use a data access resource incorrectly. |
NonTransientDataAccessException.java | Class | 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. |
NonTransientDataAccessResourceException.java | Class | Data access exception thrown when a resource fails completely and the failure is permamnet. |
OptimisticLockingFailureException.java | Class | Exception thrown on an optimistic locking violation.
This exception will be thrown either by O/R mapping tools
or by custom DAO implementations. |
PermissionDeniedDataAccessException.java | Class | Exception thrown when the underlying resource denied a permission
to access a specific element, such as a specific database table. |
PessimisticLockingFailureException.java | Class | Exception thrown on a pessimistic locking violation. |
RecoverableDataAccessException.java | Class | 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. |
TransientDataAccessException.java | Class | Root of the hierarchy of data access exceptions that are considered transient - where a previoulsy
failed operation might be able to succeed when the operation is retried without any intervention by
application-level functionality. |
TransientDataAccessResourceException.java | Class | Data access exception thrown when a resource fails temporarily and the operation can be retried. |
TypeMismatchDataAccessException.java | Class | 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. |
UncategorizedDataAccessException.java | Class | 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 can't pinpoint more precisely. |