java.lang.Object
org.hibernate.dialect.lock.SelectLockingStrategy
- All Implemented Interfaces:
- LockingStrategy
- public class SelectLockingStrategy
- extends java.lang.Object
- implements LockingStrategy
A locking strategy where the locks are obtained through select statements.
For non-read locks, this is achieved through the Dialect's specific
SELECT ... FOR UPDATE syntax.
- Since:
- 3.2
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
lockable
private final org.hibernate.persister.entity.Lockable lockable
lockMode
private final org.hibernate.LockMode lockMode
sql
private final java.lang.String sql
SelectLockingStrategy
public SelectLockingStrategy(org.hibernate.persister.entity.Lockable lockable,
org.hibernate.LockMode lockMode)
- Construct a locking strategy based on SQL SELECT statements.
lock
public void lock(java.io.Serializable id,
java.lang.Object version,
java.lang.Object object,
org.hibernate.engine.SessionImplementor session)
throws org.hibernate.StaleObjectStateException,
org.hibernate.JDBCException
- Description copied from interface:
LockingStrategy
- Acquire an appropriate type of lock on the underlying data that will
endure until the end of the current transaction.
- Specified by:
lock in interface LockingStrategy
getLockMode
protected org.hibernate.LockMode getLockMode()
generateLockString
protected java.lang.String generateLockString()