com.sleepycat.je.txn
Class ThreadLocker

java.lang.Object
  extended by com.sleepycat.je.txn.Locker
      extended by com.sleepycat.je.txn.BasicLocker
          extended by 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.


Field Summary
 
Fields inherited from class com.sleepycat.je.txn.Locker
defaultNoWait, deleteInfo, envImpl, handleLockToHandleMap, handleToHandleLockMap, id, lockManager, readUncommittedDefault, thread
 
Method Summary
protected  void checkState(boolean ignoreCalledByAbort)
          Check that this txn is not used in the wrong thread.
static ThreadLocker createThreadLocker(EnvironmentImpl env)
           
 Locker newNonTxnLocker()
          Returns a new non-transactional locker that shares locks with this locker by virtue of being a ThreadLocker for the same thread.
 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, createBasicLocker, createBasicLocker, createBasicLocker, createdNode, generateId, getAbortLsn, getTxnLocker, getWriteLockInfo, getWriteOwnerLocker, isReadCommittedIsolation, isSerializableIsolation, isTransactional, markDeleteAtTxnEnd, nonTxnOperationEnd, operationEnd, registerCursor, releaseNonTxnLocks, setHandleLockOwner, unRegisterCursor
 
Methods inherited from class com.sleepycat.je.txn.Locker
addDeleteInfo, addToHandleMaps, demoteLock, dumpLockTable, getDefaultNoWait, getId, getLockTimeout, getTxnTimeout, initApiReadLock, isHandleLockTransferrable, isReadUncommittedDefault, isTimedOut, lock, nonBlockingLock, operationEnd, operationEnd, releaseLock, setLockTimeout, setOnlyAbortable, setTxnTimeout, toString, transferHandleLock
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

createThreadLocker

public static ThreadLocker createThreadLocker(EnvironmentImpl env)
                                       throws DatabaseException
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
Returns a new non-transactional locker that shares locks with this locker by virtue of being a ThreadLocker for the same thread.

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