@Override public boolean commitTx() throws Exception { boolean success = true; for (TransactionAware txAware : this) { success = success && txAware.commitTx(); } return success; }
@Override public boolean commitTx() throws Exception { boolean success = true; for (TransactionAware txAware : this) { success = success && txAware.commitTx(); } return success; }
private void persist() throws TransactionFailureException { for (TransactionAware txAware : txAwares) { boolean success; Throwable cause = null; try { success = txAware.commitTx(); } catch (Throwable e) { success = false; cause = e; } if (!success) { String message = String.format("Unable to persist changes of transaction-aware '%s' for transaction %d. ", txAware.getTransactionAwareName(), currentTx.getTransactionId()); if (cause == null) { LOG.warn(message); } else { LOG.warn(message, cause); } abort(new TransactionFailureException(message, cause)); // abort will throw that exception } } }
private void persist() throws TransactionFailureException { for (TransactionAware txAware : txAwares) { boolean success; Throwable cause = null; try { success = txAware.commitTx(); } catch (Throwable e) { success = false; cause = e; } if (!success) { String message = String.format("Unable to persist changes of transaction-aware '%s' for transaction %d. ", txAware.getTransactionAwareName(), currentTx.getTransactionId()); if (cause == null) { LOG.warn(message); } else { LOG.warn(message, cause); } abort(new TransactionFailureException(message, cause)); // abort will throw that exception } } }