public class PessimisticLockManager extends VersionLockManager implements JDBCLockManager
| Modifier and Type | Field and Description |
|---|---|
protected JDBCStore |
_store |
static int |
LOCK_DATASTORE_ONLY |
ctx, logLOCK_NONE, LOCK_READ, LOCK_WRITE| Constructor and Description |
|---|
PessimisticLockManager() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
checkLock(java.sql.ResultSet rs,
OpenJPAStateManager sm,
int timeout)
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.
|
protected java.util.List<SQLBuffer> |
getLockRows(DBDictionary dict,
java.lang.Object id,
ClassMapping mapping,
JDBCFetchConfiguration fetch,
SQLFactory factory) |
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,
boolean postVersionCheck)
Marks the instance's transactional status in accordance with
the settings of
VersionLockManager.getVersionCheckOnReadLock()
and VersionLockManager.getVersionUpdateOnWriteLock(). |
protected void |
lockJoinTables(java.util.List<SQLBuffer> sqls,
DBDictionary dict,
java.lang.Object id,
ClassMapping mapping,
JDBCFetchConfiguration fetch,
SQLFactory factory) |
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)
Set the context this lock manager is associated with.
|
getLockLevel, getVersionCheckOnReadLock, getVersionUpdateOnWriteLock, lock, optimisticLockInternal, refreshLock, release, setLockLevel, setVersionCheckOnReadLock, setVersionUpdateOnWriteLockbeginTransaction, close, endTransaction, getContext, lockAll, skipRelationFieldLockclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitskipRelationFieldLockbeginTransaction, close, endTransaction, getLockLevel, lock, lockAll, refreshLock, releasepublic static final int LOCK_DATASTORE_ONLY
protected JDBCStore _store
public void setContext(StoreContext ctx)
LockManagersetContext in interface LockManagersetContext in class AbstractLockManagerpublic boolean selectForUpdate(Select sel, int lockLevel)
JDBCLockManagerselectForUpdate in interface JDBCLockManagerpublic void loadedForUpdate(OpenJPAStateManager sm)
JDBCLockManagerloadedForUpdate in interface JDBCLockManagerprotected void lockInternal(OpenJPAStateManager sm, int level, int timeout, java.lang.Object sdata, boolean postVersionCheck)
VersionLockManagerVersionLockManager.getVersionCheckOnReadLock()
and VersionLockManager.getVersionUpdateOnWriteLock(). Override to perform
additional locking.lockInternal in class VersionLockManagerStoreContext.transactional(java.lang.Object, boolean, org.apache.openjpa.kernel.OpCallbacks)protected java.util.List<SQLBuffer> getLockRows(DBDictionary dict, java.lang.Object id, ClassMapping mapping, JDBCFetchConfiguration fetch, SQLFactory factory)
protected void lockJoinTables(java.util.List<SQLBuffer> sqls, DBDictionary dict, java.lang.Object id, ClassMapping mapping, JDBCFetchConfiguration fetch, SQLFactory factory)
public JDBCStore getStore()
protected java.sql.PreparedStatement prepareStatement(java.sql.Connection conn,
SQLBuffer sql)
throws java.sql.SQLException
java.sql.SQLExceptionprotected java.sql.ResultSet executeQuery(java.sql.Connection conn,
java.sql.PreparedStatement stmnt,
SQLBuffer sql)
throws java.sql.SQLException
java.sql.SQLExceptionprotected void checkLock(java.sql.ResultSet rs,
OpenJPAStateManager sm,
int timeout)
throws java.sql.SQLException
java.sql.SQLExceptionCopyright © 2006-2013 Apache Software Foundation. All Rights Reserved.