public class ExpectedValueCheckingTransaction extends Object implements StoreTransaction
StoreTransaction that supports locking via
LocalLockMediator and writing and reading lock records in a
ExpectedValueCheckingStore.
This class is not safe for concurrent use by multiple threads.
Multithreaded access must be prevented or externally synchronized.| Constructor and Description |
|---|
ExpectedValueCheckingTransaction(StoreTransaction inconsistentTx,
StoreTransaction strongConsistentTx,
java.time.Duration maxReadTime) |
| Modifier and Type | Method and Description |
|---|---|
void |
commit()
Commits the transaction and persists all modifications to the backend.
|
BaseTransactionConfig |
getConfiguration()
Get the configuration for this transaction
|
StoreTransaction |
getConsistentTx() |
StoreTransaction |
getInconsistentTx() |
boolean |
isMutationStarted()
Tells whether this transaction has been used in a
ExpectedValueCheckingStore.mutate(StaticBuffer, List, List, StoreTransaction)
call. |
void |
rollback()
Aborts (or rolls back) the transaction.
|
public ExpectedValueCheckingTransaction(StoreTransaction inconsistentTx, StoreTransaction strongConsistentTx, java.time.Duration maxReadTime)
public void rollback()
throws BackendException
BaseTransactionBaseTransaction.commit() at most once per instance.rollback in interface BaseTransactionBackendExceptionpublic void commit()
throws BackendException
BaseTransactionBaseTransaction.rollback() at most once per instance.commit in interface BaseTransactionBackendExceptionpublic boolean isMutationStarted()
ExpectedValueCheckingStore.mutate(StaticBuffer, List, List, StoreTransaction)
call. When this returns true, the transaction is no longer allowed in
calls to
ExpectedValueCheckingStore.acquireLock(StaticBuffer, StaticBuffer, StaticBuffer, StoreTransaction).ExpectedValueCheckingStore.mutate(StaticBuffer, List, List, StoreTransaction)
is called on this transaction instance. Returns true forever
after.public BaseTransactionConfig getConfiguration()
BaseTransactionConfigurablegetConfiguration in interface BaseTransactionConfigurablepublic StoreTransaction getInconsistentTx()
public StoreTransaction getConsistentTx()
Copyright © 2012–2015. All rights reserved.