if (!prepareAndCommit && state != PREPARED) {
throw new TransactionNotActiveException("Transaction is not prepared");
}
checkThread();
checkTimeout();
invoke(new CommitTransactionRequest(prepareAndCommit));
state = COMMITTED;
} catch (Exception e) {
state = ROLLING_BACK;
throw ExceptionUtil.rethrow(e);
} finally {