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

Quick Search    Search Deep

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

java.lang.Object
  extended byorg.hibernate.dialect.lock.UpdateLockingStrategy
All Implemented Interfaces:
LockingStrategy

public class UpdateLockingStrategy
extends java.lang.Object
implements LockingStrategy

A locking strategy where the locks are obtained through update statements.

This strategy is not valid for read style locks.

Since:
3.2

Field Summary
private  org.hibernate.persister.entity.Lockable lockable
           
private  org.hibernate.LockMode lockMode
           
private static org.apache.commons.logging.Log log
           
private  java.lang.String sql
           
 
Constructor Summary
UpdateLockingStrategy(org.hibernate.persister.entity.Lockable lockable, org.hibernate.LockMode lockMode)
          Construct a locking strategy based on SQL UPDATE 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

log

private static final org.apache.commons.logging.Log log

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

UpdateLockingStrategy

public UpdateLockingStrategy(org.hibernate.persister.entity.Lockable lockable,
                             org.hibernate.LockMode lockMode)
Construct a locking strategy based on SQL UPDATE 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

generateLockString

protected java.lang.String generateLockString()

getLockMode

protected org.hibernate.LockMode getLockMode()