Class SelectLockingStrategy
java.lang.Object
org.hibernate.dialect.lock.AbstractSelectLockingStrategy
org.hibernate.dialect.lock.SelectLockingStrategy
- All Implemented Interfaces:
LockingStrategy
A locking strategy where an optimistic lock is obtained via a select
statement.
Differs from PessimisticWriteSelectLockingStrategy and
PessimisticReadSelectLockingStrategy in throwing
OptimisticEntityLockException.
- Since:
- 3.2
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionSelectLockingStrategy(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
-
SelectLockingStrategy
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
-