public class TransactionStore
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
TransactionStore.ArrayType
A data type that contains an array of objects with the specified data
types.
|
static class |
TransactionStore.Change
A change in a map.
|
static interface |
TransactionStore.RollbackListener
This listener can be registered with the transaction to be notified of
every compensating change during transaction rollback.
|
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
UNDO_LOG_NAME_PREFIX
The prefix for undo log entries.
|
| Constructor and Description |
|---|
TransactionStore(MVStore store)
Create a new transaction store.
|
TransactionStore(MVStore store,
DataType dataType,
int timeoutMillis)
Create a new transaction store.
|
| Modifier and Type | Method and Description |
|---|---|
Transaction |
begin()
Begin a new transaction.
|
Transaction |
begin(TransactionStore.RollbackListener listener,
int timeoutMillis,
int ownerId)
Begin a new transaction.
|
void |
close()
Close the transaction store.
|
void |
endLeftoverTransactions()
Commit all transactions that are in the committed state, and
rollback all open transactions.
|
java.util.List<Transaction> |
getOpenTransactions()
Get the list of unclosed transactions that have pending writes.
|
boolean |
hasMap(java.lang.String name)
Check whether a given map exists.
|
void |
init()
Initialize the store.
|
void |
setMaxTransactionId(int max)
Set the maximum transaction id, after which ids are re-used.
|
public static final java.lang.String UNDO_LOG_NAME_PREFIX
public TransactionStore(MVStore store)
store - the storepublic void init()
public void endLeftoverTransactions()
public void setMaxTransactionId(int max)
max - the maximum idpublic boolean hasMap(java.lang.String name)
name - the map namepublic java.util.List<Transaction> getOpenTransactions()
public void close()
public Transaction begin()
public Transaction begin(TransactionStore.RollbackListener listener, int timeoutMillis, int ownerId)
listener - to be notified in case of a rollbacktimeoutMillis - to wait for a blocking transactionownerId - of the owner (Session?) to be reported by getBlockerId