public static class TransactionStore.Transaction extends Object
Modifier and Type | Field and Description |
---|---|
static int |
STATUS_CLOSED
The status of a closed transaction (committed or rolled back).
|
static int |
STATUS_COMMITTING
The status of a transaction that is being committed, but possibly not
yet finished.
|
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.
|
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() |
String |
getName() |
int |
getStatus() |
<K,V> TransactionStore.TransactionMap<K,V> |
openMap(MVMap<K,org.h2.mvstore.db.TransactionStore.VersionedValue> map)
Open the transactional version of the given map.
|
<K,V> TransactionStore.TransactionMap<K,V> |
openMap(String name)
Open a data map.
|
<K,V> TransactionStore.TransactionMap<K,V> |
openMap(String name,
DataType keyType,
DataType valueType)
Open the map to store the data.
|
void |
prepare()
Prepare the transaction.
|
<K,V> void |
removeMap(TransactionStore.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(String name) |
long |
setSavepoint()
Create a new savepoint.
|
String |
toString() |
public static final int STATUS_CLOSED
public static final int STATUS_OPEN
public static final int STATUS_PREPARED
public static final int STATUS_COMMITTING
public int getId()
public int getStatus()
public void setName(String name)
public String getName()
public long setSavepoint()
public <K,V> TransactionStore.TransactionMap<K,V> openMap(String name)
K
- the key typeV
- the value typename
- the name of the mappublic <K,V> TransactionStore.TransactionMap<K,V> openMap(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> TransactionStore.TransactionMap<K,V> openMap(MVMap<K,org.h2.mvstore.db.TransactionStore.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 Iterator<TransactionStore.Change> getChanges(long savepointId)
savepointId
- the savepoint id, 0 meaning the beginning of the
transactionpublic <K,V> void removeMap(TransactionStore.TransactionMap<K,V> map)
map
- the mapCopyright © 2017 JBoss by Red Hat. All rights reserved.