public class Transaction
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static int |
STATUS_CLOSED
The status of a closed transaction (committed or rolled back).
|
static int |
STATUS_COMMITTED
The status of a transaction that has been logically committed or rather
marked as committed, because it might be still listed among prepared,
if it was prepared for commit.
|
static int |
STATUS_OPEN
The status of an open transaction.
|
static int |
STATUS_PREPARED
The status of a prepared transaction.
|
| Modifier and Type | Method and Description |
|---|---|
void |
commit()
Commit the transaction.
|
int |
getBlockerId() |
java.util.Iterator<TransactionStore.Change> |
getChanges(long savepointId)
Get the list of changes, starting with the latest change, up to the
given savepoint (in reverse order than they occurred).
|
int |
getId() |
java.lang.String |
getName() |
long |
getSequenceNum() |
int |
getStatus() |
boolean |
hasChanges()
Determine if any database changes were made as part of this transaction.
|
void |
markStatementEnd()
Mark an exit from SQL statement execution within this transaction.
|
void |
markStatementStart()
Mark an entry into a new SQL statement execution within this transaction.
|
<K,V> TransactionMap<K,V> |
openMap(MVMap<K,VersionedValue> map)
Open the transactional version of the given map.
|
<K,V> TransactionMap<K,V> |
openMap(java.lang.String name)
Open a data map.
|
<K,V> TransactionMap<K,V> |
openMap(java.lang.String name,
DataType keyType,
DataType valueType)
Open the map to store the data.
|
void |
prepare()
Prepare the transaction.
|
<K,V> void |
removeMap(TransactionMap<K,V> map)
Remove the map.
|
void |
rollback()
Roll the transaction back.
|
void |
rollbackToSavepoint(long savepointId)
Roll back to the given savepoint.
|
void |
setName(java.lang.String name) |
long |
setSavepoint()
Create a new savepoint.
|
java.lang.String |
toString() |
boolean |
waitFor(Transaction toWaitFor,
MVMap<?,VersionedValue> map,
java.lang.Object key)
Make this transaction to wait for the specified transaction to be closed,
because both of them try to modify the same map entry.
|
public static final int STATUS_CLOSED
public static final int STATUS_OPEN
public static final int STATUS_PREPARED
public static final int STATUS_COMMITTED
public int getId()
public long getSequenceNum()
public int getStatus()
public boolean hasChanges()
public void setName(java.lang.String name)
public java.lang.String getName()
public int getBlockerId()
public long setSavepoint()
public void markStatementStart()
public void markStatementEnd()
public <K,V> TransactionMap<K,V> openMap(java.lang.String name)
K - the key typeV - the value typename - the name of the mappublic <K,V> TransactionMap<K,V> openMap(java.lang.String name, DataType keyType, DataType valueType)
K - the key typeV - the value typename - the name of the mapkeyType - the key data typevalueType - the value data typepublic <K,V> TransactionMap<K,V> openMap(MVMap<K,VersionedValue> map)
K - the key typeV - the value typemap - the base mappublic void prepare()
public void commit()
public void rollbackToSavepoint(long savepointId)
savepointId - the savepoint idpublic void rollback()
public java.util.Iterator<TransactionStore.Change> getChanges(long savepointId)
savepointId - the savepoint id, 0 meaning the beginning of the
transactionpublic boolean waitFor(Transaction toWaitFor, MVMap<?,VersionedValue> map, java.lang.Object key)
toWaitFor - transaction to wait formap - containing blocking entrykey - of the blocking entrypublic <K,V> void removeMap(TransactionMap<K,V> map)
K - the key typeV - the value typemap - the mappublic java.lang.String toString()
toString in class java.lang.Object