public class PessimisticLockManager extends VersionLockManager implements JDBCLockManager
Modifier and Type | Field and Description |
---|---|
protected JDBCStore |
_store |
static int |
LOCK_DATASTORE_ONLY |
ctx, log
LOCK_NONE, LOCK_READ, LOCK_WRITE
Constructor and Description |
---|
PessimisticLockManager() |
Modifier and Type | Method and Description |
---|---|
protected void |
checkLock(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 ResultSet |
executeQuery(Connection conn,
PreparedStatement stmnt,
SQLBuffer sql)
This method is to provide override for non-JDBC or JDBC-like
implementation of executing query.
|
protected List<SQLBuffer> |
getLockRows(DBDictionary dict,
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,
Object sdata,
boolean postVersionCheck)
Marks the instance's transactional status in accordance with
the settings of
VersionLockManager.getVersionCheckOnReadLock()
and VersionLockManager.getVersionUpdateOnWriteLock() . |
protected void |
lockJoinTables(List<SQLBuffer> sqls,
DBDictionary dict,
Object id,
ClassMapping mapping,
JDBCFetchConfiguration fetch,
SQLFactory factory) |
protected PreparedStatement |
prepareStatement(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, setVersionUpdateOnWriteLock
beginTransaction, close, endTransaction, getContext, lockAll, skipRelationFieldLock
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
skipRelationFieldLock
beginTransaction, close, endTransaction, getLockLevel, lock, lockAll, refreshLock, release
public static final int LOCK_DATASTORE_ONLY
protected JDBCStore _store
public void setContext(StoreContext ctx)
LockManager
setContext
in interface LockManager
setContext
in class AbstractLockManager
public boolean selectForUpdate(Select sel, int lockLevel)
JDBCLockManager
selectForUpdate
in interface JDBCLockManager
public void loadedForUpdate(OpenJPAStateManager sm)
JDBCLockManager
loadedForUpdate
in interface JDBCLockManager
protected void lockInternal(OpenJPAStateManager sm, int level, int timeout, Object sdata, boolean postVersionCheck)
VersionLockManager
VersionLockManager.getVersionCheckOnReadLock()
and VersionLockManager.getVersionUpdateOnWriteLock()
. Override to perform
additional locking.lockInternal
in class VersionLockManager
StoreContext.transactional(java.lang.Object, boolean, org.apache.openjpa.kernel.OpCallbacks)
protected List<SQLBuffer> getLockRows(DBDictionary dict, Object id, ClassMapping mapping, JDBCFetchConfiguration fetch, SQLFactory factory)
protected void lockJoinTables(List<SQLBuffer> sqls, DBDictionary dict, Object id, ClassMapping mapping, JDBCFetchConfiguration fetch, SQLFactory factory)
public JDBCStore getStore()
protected PreparedStatement prepareStatement(Connection conn, SQLBuffer sql) throws SQLException
SQLException
protected ResultSet executeQuery(Connection conn, PreparedStatement stmnt, SQLBuffer sql) throws SQLException
SQLException
protected void checkLock(ResultSet rs, OpenJPAStateManager sm, int timeout) throws SQLException
SQLException
Copyright © 2006–2019 Apache Software Foundation. All rights reserved.