Class PessimisticWriteSelectLockingStrategy
java.lang.Object
org.hibernate.dialect.lock.AbstractSelectLockingStrategy
org.hibernate.dialect.lock.PessimisticWriteSelectLockingStrategy
- All Implemented Interfaces:
LockingStrategy
A pessimistic locking strategy where
LockMode.PESSIMISTIC_WRITE
lock is obtained via a select statement.
Differs from SelectLockingStrategy in throwing
PessimisticEntityLockException.
- Since:
- 3.5
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionPessimisticWriteSelectLockingStrategy(EntityPersister lockable, LockMode lockMode) Construct a locking strategy based on SQL SELECT statements. -
Method Summary
Modifier and TypeMethodDescriptionprotected HibernateExceptionconvertException(Object entity, JDBCException ex) Methods inherited from class AbstractSelectLockingStrategy
determineSql, generateLockString, generateLockString, getLockable, getLockMode, getNoWaitSql, getSkipLockedSql, lockMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface LockingStrategy
lock, lock
-
Constructor Details
-
PessimisticWriteSelectLockingStrategy
Construct a locking strategy based on SQL SELECT statements.- Parameters:
lockable- The metadata for the entity to be locked.lockMode- Indicates the type of lock to be acquired.
-
-
Method Details
-
convertException
- Overrides:
convertExceptionin classAbstractSelectLockingStrategy
-