com.sleepycat.je.txn
Class ThreadLocker
java.lang.Object
com.sleepycat.je.txn.Locker
com.sleepycat.je.txn.BasicLocker
com.sleepycat.je.txn.ThreadLocker
public class ThreadLocker
- extends BasicLocker
Extends BasicLocker to share locks among all lockers for the same thread.
This locker is used when a JE entry point is called with a null transaction
parameter.
Method Summary |
protected void |
checkState(boolean ignoreCalledByAbort)
Check that this txn is not used in the wrong thread. |
Locker |
newNonTxnLocker()
Creates a new instance of this txn for the same environment. |
boolean |
sharesLocksWith(Locker other)
Returns whether this locker can share locks with the given locker. |
Methods inherited from class com.sleepycat.je.txn.BasicLocker |
addLock, collectStats, createdNode, generateId, getAbortKnownDeleted, getAbortLsn, getOwnerAbortLsn, getTxnLocker, getWriteOwnerLocker, isReadCommittedIsolation, isSerializableIsolation, isTransactional, lock, markDeleteAtTxnEnd, moveWriteToReadLock, nonBlockingReadLock, operationEnd, operationEnd, registerCursor, releaseNonTxnLocks, removeLock, setHandleLockOwner, unRegisterCursor |
Methods inherited from class com.sleepycat.je.txn.Locker |
addDeleteInfo, addToHandleMaps, demoteLock, dumpLockTable, getId, getLockTimeout, getTxnStartMillis, getTxnTimeOut, getWaitingFor, isHandleLockTransferrable, isReadUncommittedDefault, isTimedOut, operationEnd, releaseLock, rememberHandleWriteLock, setLockTimeout, setOnlyAbortable, setTxnTimeout, setWaitingFor, toString, transferHandleLock, transferHandleLockToHandle, unregisterHandle |
ThreadLocker
public ThreadLocker(EnvironmentImpl env)
throws DatabaseException
- Creates a ThreadLocker.
- Throws:
DatabaseException
checkState
protected void checkState(boolean ignoreCalledByAbort)
throws DatabaseException
- Check that this txn is not used in the wrong thread.
- Overrides:
checkState
in class BasicLocker
- Throws:
DatabaseException
newNonTxnLocker
public Locker newNonTxnLocker()
throws DatabaseException
- Creates a new instance of this txn for the same environment. No
transactional locks are held by this object, so no locks are retained.
- Overrides:
newNonTxnLocker
in class BasicLocker
- Throws:
DatabaseException
sharesLocksWith
public boolean sharesLocksWith(Locker other)
- Returns whether this locker can share locks with the given locker.
Locks are shared when both are txns are ThreadLocker instances for the
same thread.
- Overrides:
sharesLocksWith
in class Locker
Copyright 2004-2005 Sleepycat, Inc. All Rights Reserved.