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 SummaryFields inherited from class org.apache.openjpa.jdbc.kernel.PessimisticLockManager_store, LOCK_DATASTORE_ONLYFields inherited from class org.apache.openjpa.kernel.AbstractLockManagerctx, logFields inherited from interface org.apache.openjpa.kernel.LockLevelsLOCK_NONE, LOCK_READ, LOCK_WRITE
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptiongetLockRows(DBDictionary dict, Object id, ClassMapping mapping, JDBCFetchConfiguration fetch, SQLFactory factory) protected voidlockInternal(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 voidoptimisticLockInternal(OpenJPAStateManager sm, int level, int timeout, Object sdata, boolean postLockVersionCheck) booleanselectForUpdate(Select sel, int lockLevel) Return whether to issue the given select FOR UPDATE, depending on the capabilities of the dictionary and the fetch configuration.booleanDefault not to skip relation field to maintain PessimisticLockManager semantics.Methods inherited from class org.apache.openjpa.jdbc.kernel.PessimisticLockManagercheckLock, executeQuery, getStore, loadedForUpdate, lockJoinTables, prepareStatement, setContextMethods inherited from class org.apache.openjpa.kernel.VersionLockManagergetLockLevel, getVersionCheckOnReadLock, getVersionUpdateOnWriteLock, lock, refreshLock, release, setLockLevel, setVersionCheckOnReadLock, setVersionUpdateOnWriteLockMethods inherited from class org.apache.openjpa.kernel.AbstractLockManagerbeginTransaction, close, endTransaction, getContext, lockAllMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.openjpa.kernel.LockManagerbeginTransaction, close, endTransaction, getLockLevel, lock, lockAll, refreshLock, release
- 
Constructor Details- 
MixedLockManagerpublic MixedLockManager()
 
- 
- 
Method Details- 
selectForUpdateDescription copied from interface:JDBCLockManagerReturn whether to issue the given select FOR UPDATE, depending on the capabilities of the dictionary and the fetch configuration.- Specified by:
- selectForUpdatein interface- JDBCLockManager
- Overrides:
- selectForUpdatein class- PessimisticLockManager
 
- 
lockInternalprotected void lockInternal(OpenJPAStateManager sm, int level, int timeout, Object sdata, boolean postLockVersionCheck) Description copied from class:VersionLockManagerMarks the instance's transactional status in accordance with the settings ofVersionLockManager.getVersionCheckOnReadLock()andVersionLockManager.getVersionUpdateOnWriteLock(). Override to perform additional locking.- Overrides:
- lockInternalin class- PessimisticLockManager
- See Also:
 
- 
getLockRowsprotected List<SQLBuffer> getLockRows(DBDictionary dict, Object id, ClassMapping mapping, JDBCFetchConfiguration fetch, SQLFactory factory) - Overrides:
- getLockRowsin class- PessimisticLockManager
 
- 
optimisticLockInternalprotected void optimisticLockInternal(OpenJPAStateManager sm, int level, int timeout, Object sdata, boolean postLockVersionCheck) - Overrides:
- optimisticLockInternalin class- VersionLockManager
 
- 
skipRelationFieldLockpublic boolean skipRelationFieldLock()Description copied from class:AbstractLockManagerDefault not to skip relation field to maintain PessimisticLockManager semantics.- Specified by:
- skipRelationFieldLockin interface- JDBCLockManager
- Overrides:
- skipRelationFieldLockin class- AbstractLockManager
 
 
-