Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.hibernate.dialect.lock
Class SelectLockingStrategy  view SelectLockingStrategy download SelectLockingStrategy.java

java.lang.Object
  extended byorg.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

Field Summary
private  org.hibernate.persister.entity.Lockable lockable
           
private  org.hibernate.LockMode lockMode
           
private  java.lang.String sql
           
 
Constructor Summary
SelectLockingStrategy(org.hibernate.persister.entity.Lockable lockable, org.hibernate.LockMode lockMode)
          Construct a locking strategy based on SQL SELECT statements.
 
Method Summary
protected  java.lang.String generateLockString()
           
protected  org.hibernate.LockMode getLockMode()
           
 void lock(java.io.Serializable id, java.lang.Object version, java.lang.Object object, org.hibernate.engine.SessionImplementor session)
          Acquire an appropriate type of lock on the underlying data that will endure until the end of the current transaction.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

lockable

private final org.hibernate.persister.entity.Lockable lockable

lockMode

private final org.hibernate.LockMode lockMode

sql

private final java.lang.String sql
Constructor Detail

SelectLockingStrategy

public SelectLockingStrategy(org.hibernate.persister.entity.Lockable lockable,
                             org.hibernate.LockMode lockMode)
Construct a locking strategy based on SQL SELECT statements.

Method Detail

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()