Java Reference
In-Depth Information
thrown by
JDBC
, Hibernate, and
JDO
to database access exceptions. In the next sec-
tion, we'll see how it can be used to signal concurrent update failures.
Using Spring data access exceptions
The root of the Spring data access exception class hierarchy, part of which is
shown in figure 12.4, is
DataAccessException
, which is a
RuntimeException
. There
are many subclasses of
DataAccessException
, including
ConcurrencyFailure-
Exception
, which is the superclass of exceptions that are thrown when a concur-
rency error occurs.
Its subclasses include:
OptimisticLockingFailureException
, which is thrown when an optimistic
locking failure occurs
■
PessimisticLockingFailure
, which is thrown when a pessimistic locking
failure occurs
■
CannotAcquireLockException
, which is thrown when a lock could not be
acquired
■
CannotSerializeTransactionException
, which is thrown when a transaction
could not be serialized
■
DataAccess
Exception
Concurrency
Failure
Exception
...
Optimistic
LockingFailure
Exception
Pessimistic
LockingFailure
Exception
CannotSerialize
Transaction
Exception
Figure 12.4
Part of the Spring data access
exception class hierarchy
CannotAcquire
LockException
Search WWH ::
Custom Search