@Override public void commitTransaction() { if (transactionState == TransactionState.ABORTED) { throw new IllegalStateException("Cannot call commitTransaction after calling abortTransaction"); } if (transactionState == TransactionState.NONE) { throw new IllegalStateException("There is no transaction started"); } try { if (messageSentInCurrentTransaction) { ReadConcern readConcern = transactionOptions.getReadConcern(); if (readConcern == null) { throw new MongoInternalException("Invariant violated. Transaction options read concern can not be null"); } commitInProgress = true; delegate.getOperationExecutor().execute(new CommitTransactionOperation(transactionOptions.getWriteConcern()), readConcern, this); } } finally { commitInProgress = false; transactionState = TransactionState.COMMITTED; } }
@Override public void commitTransaction() { if (transactionState == TransactionState.ABORTED) { throw new IllegalStateException("Cannot call commitTransaction after calling abortTransaction"); } if (transactionState == TransactionState.NONE) { throw new IllegalStateException("There is no transaction started"); } try { if (messageSentInCurrentTransaction) { ReadConcern readConcern = transactionOptions.getReadConcern(); if (readConcern == null) { throw new MongoInternalException("Invariant violated. Transaction options read concern can not be null"); } commitInProgress = true; delegate.getOperationExecutor().execute(new CommitTransactionOperation(transactionOptions.getWriteConcern()), readConcern, this); } } finally { commitInProgress = false; transactionState = TransactionState.COMMITTED; } }
@Override public void commitTransaction() { if (transactionState == TransactionState.ABORTED) { throw new IllegalStateException("Cannot call commitTransaction after calling abortTransaction"); } if (transactionState == TransactionState.NONE) { throw new IllegalStateException("There is no transaction started"); } try { if (messageSentInCurrentTransaction) { ReadConcern readConcern = transactionOptions.getReadConcern(); if (readConcern == null) { throw new MongoInternalException("Invariant violated. Transaction options read concern can not be null"); } commitInProgress = true; delegate.getOperationExecutor().execute(new CommitTransactionOperation(transactionOptions.getWriteConcern()), readConcern, this); } } finally { commitInProgress = false; transactionState = TransactionState.COMMITTED; } }