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
public class MixedLockManager
- extends PessimisticLockManager
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
Method Summary |
protected List<SQLBuffer> |
getLockRows(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 of VersionLockManager.getVersionCheckOnReadLock()
and VersionLockManager.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 |
skipRelationFieldLock()
Default not to skip relation field to maintain PessimisticLockManager semantics. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MixedLockManager
public MixedLockManager()
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:
selectForUpdate
in interface JDBCLockManager
- Overrides:
selectForUpdate
in class PessimisticLockManager
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 of
VersionLockManager.getVersionCheckOnReadLock()
and VersionLockManager.getVersionUpdateOnWriteLock()
. Override to perform
additional locking.
- Overrides:
lockInternal
in class PessimisticLockManager
- See Also:
StoreContext.transactional(java.lang.Object, boolean, org.apache.openjpa.kernel.OpCallbacks)
getLockRows
protected List<SQLBuffer> getLockRows(DBDictionary dict,
Object id,
ClassMapping mapping,
JDBCFetchConfiguration fetch,
SQLFactory factory)
- Overrides:
getLockRows
in class PessimisticLockManager
optimisticLockInternal
protected void optimisticLockInternal(OpenJPAStateManager sm,
int level,
int timeout,
Object sdata,
boolean postLockVersionCheck)
- Overrides:
optimisticLockInternal
in class VersionLockManager
skipRelationFieldLock
public boolean skipRelationFieldLock()
- Description copied from class:
AbstractLockManager
- Default not to skip relation field to maintain PessimisticLockManager semantics.
- Specified by:
skipRelationFieldLock
in interface JDBCLockManager
- Overrides:
skipRelationFieldLock
in class AbstractLockManager
Copyright © 2006-2010 Apache Software Foundation. All Rights Reserved.