|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sleepycat.je.txn.Locker
com.sleepycat.je.txn.Txn
com.sleepycat.je.rep.txn.ReadonlyTxn
public class ReadonlyTxn
A ReadonlyTxn represents a user initiated transaction on a Replica. As its name implies it is used to implement the read-only semantics for access to the replicated environment on the Replica. In addition, it uses the transaction hooks defined on Txn to implement the ReplicaConsistencyPolicy.
Field Summary |
---|
Fields inherited from class com.sleepycat.je.txn.Txn |
---|
ACCUMULATED_LIMIT, commitLsn, deletedDatabases, firstLoggedLsn, lastLoggedLsn, openedDatabaseHandles, repContext, undoDatabases |
Fields inherited from class com.sleepycat.je.txn.Locker |
---|
defaultNoWait, deleteInfo, envImpl, id, lockManager, readUncommittedDefault, thread |
Constructor Summary | |
---|---|
ReadonlyTxn(EnvironmentImpl envImpl,
TransactionConfig config)
|
Method Summary | |
---|---|
(package private) static void |
checkConsistency(RepImpl repImpl,
ReplicaConsistencyPolicy policy)
Utility method used here and by ReplicaThreadLocker. |
void |
disallowReplicaWrite()
Unconditionally throws ReplicaWriteException because this locker was created on a replica. |
boolean |
isReplicationDefined()
Used for debugging checks to ensure that replication-defined lockers are used for accessing replicated databases. |
LockResult |
lockInternal(long lsn,
LockType lockType,
boolean noWait,
boolean jumpAheadOfWaiters,
DatabaseImpl database)
Provides a wrapper to screen for write locks. |
void |
preLogWithoutLock(DatabaseImpl database)
If logging occurs before locking, we must screen out write locks here. |
protected void |
txnBeginHook(TransactionConfig config)
Verifies that consistency requirements are met before allowing the transaction to proceed. |
Methods inherited from class com.sleepycat.je.txn.Locker |
---|
addDeleteInfo, allowReleaseLockAfterLsnChange, demoteLock, dumpLockTable, getDefaultNoWait, getEnvironment, getId, getInitialLockTimeout, getLockTimeout, getPreemptable, getTxnTimeout, isReadUncommittedDefault, isTimedOut, lock, lockAfterLsnChange, nonBlockingLock, openCursorHook, operationEnd, operationEnd, releaseLock, setClosingLocker, setLockTimeout, setPreemptable, setPreempted, setTxnTimeout, sharesLocksWith, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ReadonlyTxn(EnvironmentImpl envImpl, TransactionConfig config) throws DatabaseException
DatabaseException
Method Detail |
---|
public LockResult lockInternal(long lsn, LockType lockType, boolean noWait, boolean jumpAheadOfWaiters, DatabaseImpl database) throws LockNotAvailableException, LockConflictException, DatabaseException
lockInternal
in class Txn
lsn
- is the node to lock.lockType
- is the type of lock to request.noWait
- is true to override the defaultNoWait setting. If true,
or if defaultNoWait is true, throws LockNotAvailableException if the
lock cannot be granted without waiting.jumpAheadOfWaiters
- grant the lock before other waiters, if any.database
- is the database containing lsn.
LockConflictException
- if a blocking lock could not be acquired.
LockNotAvailableException
DatabaseException
Locker.lockInternal(long, com.sleepycat.je.txn.LockType, boolean, boolean, com.sleepycat.je.dbi.DatabaseImpl)
public void preLogWithoutLock(DatabaseImpl database)
preLogWithoutLock
in class Txn
public void disallowReplicaWrite()
disallowReplicaWrite
in class Locker
protected void txnBeginHook(TransactionConfig config) throws ReplicaConsistencyException, DatabaseException
txnBeginHook
in class Txn
config
- the transaction config that applies to the txn
DatabaseException
- if there is a failure
ReplicaConsistencyException
static void checkConsistency(RepImpl repImpl, ReplicaConsistencyPolicy policy)
public boolean isReplicationDefined()
Locker
isReplicationDefined
in class Locker
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |