| 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, transferHandleLockpublic 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
DatabaseExceptionpublic Txn(EnvironmentImpl envImpl, TransactionConfig config, long id) throws DatabaseException
DatabaseExceptionpublic Txn()
protected long generateId(TxnManager txnManager)
generateId in class Lockerpublic 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
DatabaseExceptionpublic void commit(javax.transaction.xa.Xid xid)
throws DatabaseException
DatabaseExceptionpublic void abort(javax.transaction.xa.Xid xid)
throws DatabaseException
DatabaseExceptionpublic long commit()
throws DatabaseException
DatabaseExceptionpublic long commit(byte flushSyncBehavior)
throws DatabaseException
DatabaseExceptionpublic long abort(boolean forceFlush)
throws DatabaseException
DatabaseExceptionpublic void addLogInfo(long lastLsn)
throws DatabaseException
DatabaseExceptionpublic void markDeleteAtTxnEnd(DatabaseImpl dbImpl, boolean deleteAtCommit) throws DatabaseException
LockermarkDeleteAtTxnEnd in class LockerdbImpl - databaseImpl to removedeleteAtCommit - true if this databaseImpl should be cleaned on
commit, false if it should be cleaned on abort.mb - environment memory budget.DatabaseExceptionpublic boolean createdNode(long nodeId)
throws DatabaseException
createdNode in class LockerDatabaseExceptionpublic long getAbortLsn(long nodeId)
throws DatabaseException
getAbortLsn in class LockerDatabaseExceptionpublic WriteLockInfo getWriteLockInfo(long nodeId) throws DatabaseException
getWriteLockInfo in class LockerDatabaseExceptionpublic boolean isTransactional()
isTransactional in class Lockerpublic boolean isSerializableIsolation()
isSerializableIsolation in class Lockerpublic boolean isReadCommittedIsolation()
isReadCommittedIsolation in class Lockerpublic Txn getTxnLocker()
getTxnLocker in class Lockerpublic Locker newNonTxnLocker() throws DatabaseException
newNonTxnLocker in class LockerDatabaseExceptionpublic void releaseNonTxnLocks()
throws DatabaseException
releaseNonTxnLocks in class LockerDatabaseExceptionpublic void operationEnd()
throws DatabaseException
operationEnd in class LockerDatabaseExceptionpublic void operationEnd(boolean operationOK)
throws DatabaseException
operationEnd in class LockeroperationOK - is whether the operation succeeded, since
that may impact ending behavior. (i.e for AutoTxn)DatabaseExceptionpublic void setHandleLockOwner(boolean ignore,
Database dbHandle,
boolean dbIsClosing)
throws DatabaseException
setHandleLockOwner in class LockerDatabaseExceptionpublic void registerCursor(CursorImpl cursor) throws DatabaseException
registerCursor in class LockerDatabaseExceptionpublic void unRegisterCursor(CursorImpl cursor) throws DatabaseException
unRegisterCursor in class LockerDatabaseExceptionpublic boolean isHandleLockTransferrable()
isHandleLockTransferrable in class Lockerpublic LockStats collectStats(LockStats stats) throws DatabaseException
collectStats in class LockerDatabaseExceptionpublic void setOnlyAbortable()
public boolean getOnlyAbortable()
protected void checkState(boolean calledByAbort)
throws DatabaseException
checkState in class LockerDatabaseExceptionpublic int getLogSize()
getLogSize in interface LoggableLoggable.getLogSize()public void writeToLog(java.nio.ByteBuffer logBuffer)
LoggablewriteToLog in interface LoggablelogBuffer - is the destination bufferLoggable.writeToLog(java.nio.ByteBuffer)public void readFromLog(java.nio.ByteBuffer logBuffer,
byte entryTypeVersion)
LoggablereadFromLog in interface LoggableIt's ok for FindBugs to whine about id not being synchronized.public void dumpLog(java.lang.StringBuffer sb,
boolean verbose)
LoggabledumpLog in interface Loggablesb - destination string bufferverbose - if true, dump the full, verbose versionLoggable.dumpLog(java.lang.StringBuffer, boolean)public long getTransactionId()
getTransactionId in interface LoggableLoggable.getTransactionId()