public abstract class RunTransaction
extends java.lang.Object
| Modifier and Type | Method and Description | 
|---|---|
abstract void | 
doTransactionWork(Transaction txn)
Must be implemented to perform operations using the given Transaction. 
 | 
void | 
onReplicaWrite(ReplicaWriteException replicaWrite)
May be optionally overridden to handle a ReplicaWriteException. 
 | 
void | 
onRetryFailure(OperationFailureException lastException)
May be optionally overridden to handle a failure after the
 TRANSACTION_RETRY_MAX has been exceeded. 
 | 
void | 
run(boolean readOnly)
Runs a transaction, calls the doTransactionWork method, and retries as
 needed. 
 | 
public void run(boolean readOnly)
         throws java.lang.InterruptedException,
                EnvironmentFailureException
 If the transaction is read only, it uses Durability.READ_ONLY_TXN for
 the Transaction. Since this Durability policy does not call for any
 acknowledgments, it eliminates the possibility of a InsufficientReplicasException being thrown from the call to Environment.beginTransaction(com.sleepycat.je.Transaction, com.sleepycat.je.TransactionConfig) for a read only transaction on a Master,
 which is an overly stringent requirement. This makes the Master more
 available for read operations.
readOnly - determines whether the transaction to be run is read
 only.java.lang.InterruptedExceptionEnvironmentFailureExceptionpublic abstract void doTransactionWork(Transaction txn)
public void onReplicaWrite(ReplicaWriteException replicaWrite)
public void onRetryFailure(OperationFailureException lastException)
Copyright (c) 2002, 2017 Oracle and/or its affiliates. All rights reserved.