org.apache.openjpa.jdbc.kernel
Class PessimisticLockManager
java.lang.Object
   org.apache.openjpa.kernel.AbstractLockManager
org.apache.openjpa.kernel.AbstractLockManager
       org.apache.openjpa.kernel.VersionLockManager
org.apache.openjpa.kernel.VersionLockManager
           org.apache.openjpa.jdbc.kernel.PessimisticLockManager
org.apache.openjpa.jdbc.kernel.PessimisticLockManager
- All Implemented Interfaces: 
- JDBCLockManager, LockLevels, LockManager, Closeable
- public class PessimisticLockManager 
- extends VersionLockManager- implements JDBCLockManager
Lock manager that uses exclusive database locks.
- Author:
- Marc Prud'hommeaux
 
 
 
 
| Method Summary | 
| protected  void | checkLock(java.sql.ResultSet rs,
          OpenJPAStateManager sm)This method is to provide override for non-JDBC or JDBC-like 
 implementation of checking lock from the result set.
 | 
| protected  java.sql.ResultSet | executeQuery(java.sql.Connection conn,
             java.sql.PreparedStatement stmnt,
             SQLBuffer sql)This method is to provide override for non-JDBC or JDBC-like 
 implementation of executing query.
 | 
|  JDBCStore | getStore()
 | 
|  void | loadedForUpdate(OpenJPAStateManager sm)Notification that the given instance was loaded via a result set
 produced by a FOR UPDATE select.
 | 
| protected  void | lockInternal(OpenJPAStateManager sm,
             int level,
             int timeout,
             java.lang.Object sdata)
 | 
| protected  java.sql.PreparedStatement | prepareStatement(java.sql.Connection conn,
                 SQLBuffer sql)This method is to provide override for non-JDBC or JDBC-like 
 implementation of preparing statement.
 | 
|  boolean | selectForUpdate(Select sel,
                int lockLevel)Return whether to issue the given select FOR UPDATE, depending on
 the capabilities of the dictionary and the fetch configuration.
 | 
|  void | setContext(StoreContext ctx)
 | 
| protected  void | setTimeout(java.sql.PreparedStatement stmnt,
           int timeout)This method is to provide override for non-JDBC or JDBC-like 
 implementation of setting query timeout.
 | 
 
 
 
| Methods inherited from class java.lang.Object | 
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
 
 
LOCK_DATASTORE_ONLY
public static final int LOCK_DATASTORE_ONLY
- See Also:
- Constant Field Values
PessimisticLockManager
public PessimisticLockManager()
setContext
public void setContext(StoreContext ctx)
- 
- Specified by:
- setContextin interface- LockManager
- Overrides:
- setContextin class- AbstractLockManager
 
- 
 
selectForUpdate
public boolean selectForUpdate(Select sel,
                               int lockLevel)
- Description copied from interface: JDBCLockManager
- Return whether to issue the given select FOR UPDATE, depending on
 the capabilities of the dictionary and the fetch configuration.
 
- 
- Specified by:
- selectForUpdatein interface- JDBCLockManager
 
- 
 
loadedForUpdate
public void loadedForUpdate(OpenJPAStateManager sm)
- Description copied from interface: JDBCLockManager
- Notification that the given instance was loaded via a result set
 produced by a FOR UPDATE select.
 
- 
- Specified by:
- loadedForUpdatein interface- JDBCLockManager
 
- 
 
lockInternal
protected void lockInternal(OpenJPAStateManager sm,
                            int level,
                            int timeout,
                            java.lang.Object sdata)
- 
- Overrides:
- lockInternalin class- VersionLockManager
 
- 
 
getStore
public JDBCStore getStore()
- 
 
- 
 
prepareStatement
protected java.sql.PreparedStatement prepareStatement(java.sql.Connection conn,
                                                      SQLBuffer sql)
                                               throws java.sql.SQLException
- This method is to provide override for non-JDBC or JDBC-like 
 implementation of preparing statement.
 
- 
 
- 
- Throws:
- java.sql.SQLException
 
setTimeout
protected void setTimeout(java.sql.PreparedStatement stmnt,
                          int timeout)
                   throws java.sql.SQLException
- This method is to provide override for non-JDBC or JDBC-like 
 implementation of setting query timeout.
 
- 
 
- 
- Throws:
- java.sql.SQLException
 
executeQuery
protected java.sql.ResultSet executeQuery(java.sql.Connection conn,
                                          java.sql.PreparedStatement stmnt,
                                          SQLBuffer sql)
                                   throws java.sql.SQLException
- This method is to provide override for non-JDBC or JDBC-like 
 implementation of executing query.
 
- 
 
- 
- Throws:
- java.sql.SQLException
 
checkLock
protected void checkLock(java.sql.ResultSet rs,
                         OpenJPAStateManager sm)
                  throws java.sql.SQLException
- This method is to provide override for non-JDBC or JDBC-like 
 implementation of checking lock from the result set.
 
- 
 
- 
- Throws:
- java.sql.SQLException
 
Copyright © 2006-2008 Apache Software Foundation. All Rights Reserved.