use of com.scalar.db.exception.transaction.CommitConflictException in project scalardb by scalar-labs.
the class TwoPhaseConsensusCommit method prepare.
@Override
public void prepare() throws PreparationException {
checkStatus("The transaction is not active", Status.ACTIVE);
beforePrepareHook.run();
try {
commit.prepare(crud.getSnapshot(), false);
status = Status.PREPARED;
} catch (CommitConflictException e) {
status = Status.PREPARE_FAILED;
throw new PreparationConflictException("prepare failed", e);
} catch (CommitException e) {
status = Status.PREPARE_FAILED;
throw new PreparationException("prepare failed", e);
} catch (UnknownTransactionStatusException e) {
// Should not be reached here because CommitHandler.prepare() with abortIfError=false won't
// throw UnknownTransactionStatusException
}
}
use of com.scalar.db.exception.transaction.CommitConflictException in project scalardb by scalar-labs.
the class TwoPhaseConsensusCommit method validate.
@Override
public void validate() throws ValidationException {
checkStatus("The transaction is not prepared", Status.PREPARED);
try {
commit.preCommitValidation(crud.getSnapshot(), false);
status = Status.VALIDATED;
} catch (CommitConflictException e) {
status = Status.VALIDATION_FAILED;
throw new ValidationConflictException("validation failed", e);
} catch (CommitException e) {
status = Status.VALIDATION_FAILED;
throw new ValidationException("validation failed", e);
} catch (UnknownTransactionStatusException e) {
// Should not be reached here because CommitHandler.prepare() with abortIfError=false won't
// throw UnknownTransactionStatusException
}
}
Aggregations