Modifier and Type | Field and Description |
---|---|
static int |
ACCUMULATED_LIMIT |
static byte |
TXN_NOSYNC |
static byte |
TXN_SYNC |
static byte |
TXN_WRITE_NOSYNC |
defaultNoWait, deleteInfo, envImpl, handleLockToHandleMap, handleToHandleLockMap, id, lockManager, lockTimeOutMillis, readUncommittedDefault, thread
Constructor and Description |
---|
Txn()
Constructor for reading from log.
|
Txn(EnvironmentImpl envImpl,
TransactionConfig config)
Create a transaction from Environment.txnBegin.
|
Txn(EnvironmentImpl envImpl,
TransactionConfig config,
long id) |
Modifier and Type | Method and Description |
---|---|
long |
abort(boolean forceFlush)
Abort this transaction.
|
void |
abort(javax.transaction.xa.Xid xid) |
void |
addLogInfo(long lastLsn)
Called by the recovery manager when logging a transaction aware object.
|
protected void |
checkState(boolean calledByAbort)
Throw an exception if the transaction is not open.
|
LockStats |
collectStats(LockStats stats)
stats
|
long |
commit()
Call commit() with the default sync configuration property.
|
long |
commit(byte flushSyncBehavior)
Commit this transaction
1.
|
void |
commit(javax.transaction.xa.Xid xid) |
boolean |
createdNode(long nodeId) |
void |
dumpLog(java.lang.StringBuffer sb,
boolean verbose)
Write the object into the string buffer for log dumping.
|
protected long |
generateId(TxnManager txnManager)
UserTxns get a new unique id for each instance.
|
long |
getAbortLsn(long nodeId) |
int |
getLogSize() |
boolean |
getOnlyAbortable()
Get the state of a transaction's ONLY_ABORTABLE.
|
boolean |
getPrepared() |
long |
getTransactionId() |
Txn |
getTxnLocker()
This is a transactional locker.
|
WriteLockInfo |
getWriteLockInfo(long nodeId) |
boolean |
isHandleLockTransferrable() |
boolean |
isReadCommittedIsolation()
Is read-committed isolation if so configured.
|
boolean |
isSerializableIsolation()
Is serializable isolation if so configured.
|
boolean |
isSuspended() |
boolean |
isTransactional()
Is always transactional.
|
void |
markDeleteAtTxnEnd(DatabaseImpl dbImpl,
boolean deleteAtCommit)
Database operations like remove and truncate leave behind
residual DatabaseImpls that must be purged at transaction
commit or abort.
|
Locker |
newNonTxnLocker()
Returns 'this', since this locker holds no non-transactional locks.
|
void |
operationEnd()
Created transactions do nothing at the end of the operation.
|
void |
operationEnd(boolean operationOK)
Created transactions do nothing at the end of the operation.
|
int |
prepare(javax.transaction.xa.Xid xid) |
void |
readFromLog(java.nio.ByteBuffer logBuffer,
byte entryTypeVersion)
Initialize this object from the data in itemBuf.
|
void |
registerCursor(CursorImpl cursor)
Cursors operating under this transaction are added to the collection.
|
void |
releaseNonTxnLocks()
This locker holds no non-transactional locks.
|
void |
setHandleLockOwner(boolean ignore,
Database dbHandle,
boolean dbIsClosing)
Created transactions don't transfer locks until commit.
|
void |
setOnlyAbortable()
Set the state of a transaction to ONLY_ABORTABLE.
|
void |
setPrepared(boolean prepared) |
void |
setSuspended(boolean suspended) |
void |
unRegisterCursor(CursorImpl cursor)
Remove a cursor from the collection.
|
void |
writeToLog(java.nio.ByteBuffer logBuffer)
Serialize this object into the buffer.
|
addDeleteInfo, addToHandleMaps, demoteLock, dumpLockTable, getDefaultNoWait, getId, getLockTimeout, getTxnTimeOut, isReadUncommittedDefault, isTimedOut, lock, nonBlockingLock, operationEnd, releaseLock, setLockTimeout, setTxnTimeout, sharesLocksWith, toString, transferHandleLock
public static final byte TXN_NOSYNC
public static final byte TXN_WRITE_NOSYNC
public static final byte TXN_SYNC
public static int ACCUMULATED_LIMIT
public Txn(EnvironmentImpl envImpl, TransactionConfig config) throws DatabaseException
DatabaseException
public Txn(EnvironmentImpl envImpl, TransactionConfig config, long id) throws DatabaseException
DatabaseException
public Txn()
protected long generateId(TxnManager txnManager)
generateId
in class Locker
public boolean getPrepared()
public void setPrepared(boolean prepared)
public void setSuspended(boolean suspended)
public boolean isSuspended()
public int prepare(javax.transaction.xa.Xid xid) throws DatabaseException
DatabaseException
public void commit(javax.transaction.xa.Xid xid) throws DatabaseException
DatabaseException
public void abort(javax.transaction.xa.Xid xid) throws DatabaseException
DatabaseException
public long commit() throws DatabaseException
DatabaseException
public long commit(byte flushSyncBehavior) throws DatabaseException
DatabaseException
public long abort(boolean forceFlush) throws DatabaseException
DatabaseException
public void addLogInfo(long lastLsn) throws DatabaseException
DatabaseException
public void markDeleteAtTxnEnd(DatabaseImpl dbImpl, boolean deleteAtCommit) throws DatabaseException
Locker
markDeleteAtTxnEnd
in class Locker
dbImpl
- databaseImpl to removedeleteAtCommit
- true if this databaseImpl should be cleaned on
commit, false if it should be cleaned on abort.mb
- environment memory budget.DatabaseException
public boolean createdNode(long nodeId) throws DatabaseException
createdNode
in class Locker
DatabaseException
public long getAbortLsn(long nodeId) throws DatabaseException
getAbortLsn
in class Locker
DatabaseException
public WriteLockInfo getWriteLockInfo(long nodeId) throws DatabaseException
getWriteLockInfo
in class Locker
DatabaseException
public boolean isTransactional()
isTransactional
in class Locker
public boolean isSerializableIsolation()
isSerializableIsolation
in class Locker
public boolean isReadCommittedIsolation()
isReadCommittedIsolation
in class Locker
public Txn getTxnLocker()
getTxnLocker
in class Locker
public Locker newNonTxnLocker() throws DatabaseException
newNonTxnLocker
in class Locker
DatabaseException
public void releaseNonTxnLocks() throws DatabaseException
releaseNonTxnLocks
in class Locker
DatabaseException
public void operationEnd() throws DatabaseException
operationEnd
in class Locker
DatabaseException
public void operationEnd(boolean operationOK) throws DatabaseException
operationEnd
in class Locker
operationOK
- is whether the operation succeeded, since
that may impact ending behavior. (i.e for AutoTxn)DatabaseException
public void setHandleLockOwner(boolean ignore, Database dbHandle, boolean dbIsClosing) throws DatabaseException
setHandleLockOwner
in class Locker
DatabaseException
public void registerCursor(CursorImpl cursor) throws DatabaseException
registerCursor
in class Locker
DatabaseException
public void unRegisterCursor(CursorImpl cursor) throws DatabaseException
unRegisterCursor
in class Locker
DatabaseException
public boolean isHandleLockTransferrable()
isHandleLockTransferrable
in class Locker
public LockStats collectStats(LockStats stats) throws DatabaseException
collectStats
in class Locker
DatabaseException
public void setOnlyAbortable()
public boolean getOnlyAbortable()
protected void checkState(boolean calledByAbort) throws DatabaseException
checkState
in class Locker
DatabaseException
public int getLogSize()
getLogSize
in interface Loggable
Loggable.getLogSize()
public void writeToLog(java.nio.ByteBuffer logBuffer)
Loggable
writeToLog
in interface Loggable
logBuffer
- is the destination bufferLoggable.writeToLog(java.nio.ByteBuffer)
public void readFromLog(java.nio.ByteBuffer logBuffer, byte entryTypeVersion)
Loggable
readFromLog
in interface Loggable
It's ok for FindBugs to whine about id not being synchronized.
public void dumpLog(java.lang.StringBuffer sb, boolean verbose)
Loggable
dumpLog
in interface Loggable
sb
- destination string bufferverbose
- if true, dump the full, verbose versionLoggable.dumpLog(java.lang.StringBuffer, boolean)
public long getTransactionId()
getTransactionId
in interface Loggable
Loggable.getTransactionId()