Package org.apache.openjpa.jdbc.kernel
Class MixedLockManager
java.lang.Object
org.apache.openjpa.kernel.AbstractLockManager
org.apache.openjpa.kernel.VersionLockManager
org.apache.openjpa.jdbc.kernel.PessimisticLockManager
org.apache.openjpa.jdbc.kernel.MixedLockManager
- All Implemented Interfaces:
JDBCLockManager
,LockLevels
,LockManager
,Closeable
Mixed lock manager implements both optimistic and pessimistic locking
semantics in parallel to the JPA 2.0 specification.
- Since:
- 2.0.0
- Author:
- Albert Lee
-
Field Summary
Fields inherited from class org.apache.openjpa.jdbc.kernel.PessimisticLockManager
_store, LOCK_DATASTORE_ONLY
Fields inherited from class org.apache.openjpa.kernel.AbstractLockManager
ctx, log
Fields inherited from interface org.apache.openjpa.kernel.LockLevels
LOCK_NONE, LOCK_READ, LOCK_WRITE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetLockRows
(DBDictionary dict, Object id, ClassMapping mapping, JDBCFetchConfiguration fetch, SQLFactory factory) protected void
lockInternal
(OpenJPAStateManager sm, int level, int timeout, Object sdata, boolean postLockVersionCheck) Marks the instance's transactional status in accordance with the settings ofVersionLockManager.getVersionCheckOnReadLock()
andVersionLockManager.getVersionUpdateOnWriteLock()
.protected void
optimisticLockInternal
(OpenJPAStateManager sm, int level, int timeout, Object sdata, boolean postLockVersionCheck) 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.boolean
Default not to skip relation field to maintain PessimisticLockManager semantics.Methods inherited from class org.apache.openjpa.jdbc.kernel.PessimisticLockManager
checkLock, executeQuery, getStore, loadedForUpdate, lockJoinTables, prepareStatement, setContext
Methods inherited from class org.apache.openjpa.kernel.VersionLockManager
getLockLevel, getVersionCheckOnReadLock, getVersionUpdateOnWriteLock, lock, refreshLock, release, setLockLevel, setVersionCheckOnReadLock, setVersionUpdateOnWriteLock
Methods inherited from class org.apache.openjpa.kernel.AbstractLockManager
beginTransaction, close, endTransaction, getContext, lockAll
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.openjpa.kernel.LockManager
beginTransaction, close, endTransaction, getLockLevel, lock, lockAll, refreshLock, release
-
Constructor Details
-
MixedLockManager
public MixedLockManager()
-
-
Method Details
-
selectForUpdate
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:
selectForUpdate
in interfaceJDBCLockManager
- Overrides:
selectForUpdate
in classPessimisticLockManager
-
lockInternal
protected void lockInternal(OpenJPAStateManager sm, int level, int timeout, Object sdata, boolean postLockVersionCheck) Description copied from class:VersionLockManager
Marks the instance's transactional status in accordance with the settings ofVersionLockManager.getVersionCheckOnReadLock()
andVersionLockManager.getVersionUpdateOnWriteLock()
. Override to perform additional locking.- Overrides:
lockInternal
in classPessimisticLockManager
- See Also:
-
getLockRows
protected List<SQLBuffer> getLockRows(DBDictionary dict, Object id, ClassMapping mapping, JDBCFetchConfiguration fetch, SQLFactory factory) - Overrides:
getLockRows
in classPessimisticLockManager
-
optimisticLockInternal
protected void optimisticLockInternal(OpenJPAStateManager sm, int level, int timeout, Object sdata, boolean postLockVersionCheck) - Overrides:
optimisticLockInternal
in classVersionLockManager
-
skipRelationFieldLock
public boolean skipRelationFieldLock()Description copied from class:AbstractLockManager
Default not to skip relation field to maintain PessimisticLockManager semantics.- Specified by:
skipRelationFieldLock
in interfaceJDBCLockManager
- Overrides:
skipRelationFieldLock
in classAbstractLockManager
-