/** * Invoke {@code doRollback}, handling rollback exceptions properly. * @param status object representing the transaction * @param ex the thrown application exception or error * @throws TransactionException in case of rollback failure * @see #doRollback */ private void doRollbackOnCommitException(DefaultTransactionStatus status, Throwable ex) throws TransactionException { try { if (status.isNewTransaction()) { if (status.isDebug()) { logger.debug("Initiating transaction rollback after commit exception", ex); } doRollback(status); } else if (status.hasTransaction() && isGlobalRollbackOnParticipationFailure()) { if (status.isDebug()) { logger.debug("Marking existing transaction as rollback-only after commit exception", ex); } doSetRollbackOnly(status); } } catch (RuntimeException | Error rbex) { logger.error("Commit exception overridden by rollback exception", ex); triggerAfterCompletion(status, TransactionSynchronization.STATUS_UNKNOWN); throw rbex; } triggerAfterCompletion(status, TransactionSynchronization.STATUS_ROLLED_BACK); }
/** * Invoke {@code doRollback}, handling rollback exceptions properly. * @param status object representing the transaction * @param ex the thrown application exception or error * @throws TransactionException in case of rollback failure * @see #doRollback */ private void doRollbackOnCommitException(DefaultTransactionStatus status, Throwable ex) throws TransactionException { try { if (status.isNewTransaction()) { if (status.isDebug()) { logger.debug("Initiating transaction rollback after commit exception", ex); } doRollback(status); } else if (status.hasTransaction() && isGlobalRollbackOnParticipationFailure()) { if (status.isDebug()) { logger.debug("Marking existing transaction as rollback-only after commit exception", ex); } doSetRollbackOnly(status); } } catch (RuntimeException | Error rbex) { logger.error("Commit exception overridden by rollback exception", ex); triggerAfterCompletion(status, TransactionSynchronization.STATUS_UNKNOWN); throw rbex; } triggerAfterCompletion(status, TransactionSynchronization.STATUS_ROLLED_BACK); }
triggerAfterCompletion(status, TransactionSynchronization.STATUS_UNKNOWN); throw ex; triggerAfterCompletion(status, TransactionSynchronization.STATUS_ROLLED_BACK);
triggerAfterCompletion(status, TransactionSynchronization.STATUS_ROLLED_BACK); throw ex; triggerAfterCompletion(status, TransactionSynchronization.STATUS_UNKNOWN); triggerAfterCompletion(status, TransactionSynchronization.STATUS_COMMITTED);
triggerAfterCompletion(status, TransactionSynchronization.STATUS_UNKNOWN); throw ex; triggerAfterCompletion(status, TransactionSynchronization.STATUS_ROLLED_BACK);
triggerAfterCompletion(status, TransactionSynchronization.STATUS_ROLLED_BACK); throw ex; triggerAfterCompletion(status, TransactionSynchronization.STATUS_UNKNOWN); triggerAfterCompletion(status, TransactionSynchronization.STATUS_COMMITTED);
/** * Invoke <code>doRollback</code>, handling rollback exceptions properly. * @param status object representing the transaction * @param ex the thrown application exception or error * @throws TransactionException in case of rollback failure * @see #doRollback */ private void doRollbackOnCommitException(DefaultTransactionStatus status, Throwable ex) throws TransactionException { try { if (status.isNewTransaction()) { if (status.isDebug()) { logger.debug("Initiating transaction rollback on commit exception", ex); } doRollback(status); } } catch (RuntimeException rbex) { logger.error("Commit exception overridden by rollback exception", ex); triggerAfterCompletion(status, TransactionSynchronization.STATUS_UNKNOWN); throw rbex; } catch (Error rberr) { logger.error("Commit exception overridden by rollback exception", ex); triggerAfterCompletion(status, TransactionSynchronization.STATUS_UNKNOWN); throw rberr; } triggerAfterCompletion(status, TransactionSynchronization.STATUS_ROLLED_BACK); }
/** * Invoke {@code doRollback}, handling rollback exceptions properly. * @param status object representing the transaction * @param ex the thrown application exception or error * @throws TransactionException in case of rollback failure * @see #doRollback */ private void doRollbackOnCommitException(DefaultTransactionStatus status, Throwable ex) throws TransactionException { try { if (status.isNewTransaction()) { if (status.isDebug()) { logger.debug("Initiating transaction rollback after commit exception", ex); } doRollback(status); } else if (status.hasTransaction() && isGlobalRollbackOnParticipationFailure()) { if (status.isDebug()) { logger.debug("Marking existing transaction as rollback-only after commit exception", ex); } doSetRollbackOnly(status); } } catch (RuntimeException | Error rbex) { logger.error("Commit exception overridden by rollback exception", ex); triggerAfterCompletion(status, TransactionSynchronization.STATUS_UNKNOWN); throw rbex; } triggerAfterCompletion(status, TransactionSynchronization.STATUS_ROLLED_BACK); }
/** * Invoke {@code doRollback}, handling rollback exceptions properly. * @param status object representing the transaction * @param ex the thrown application exception or error * @throws TransactionException in case of rollback failure * @see #doRollback */ private void doRollbackOnCommitException(DefaultTransactionStatus status, Throwable ex) throws TransactionException { try { if (status.isNewTransaction()) { if (status.isDebug()) { logger.debug("Initiating transaction rollback after commit exception", ex); } doRollback(status); } else if (status.hasTransaction() && isGlobalRollbackOnParticipationFailure()) { if (status.isDebug()) { logger.debug("Marking existing transaction as rollback-only after commit exception", ex); } doSetRollbackOnly(status); } } catch (RuntimeException | Error rbex) { logger.error("Commit exception overridden by rollback exception", ex); triggerAfterCompletion(status, TransactionSynchronization.STATUS_UNKNOWN); throw rbex; } triggerAfterCompletion(status, TransactionSynchronization.STATUS_ROLLED_BACK); }
triggerAfterCompletion(status, TransactionSynchronization.STATUS_UNKNOWN); throw ex; triggerAfterCompletion(status, TransactionSynchronization.STATUS_UNKNOWN); throw err; triggerAfterCompletion(status, TransactionSynchronization.STATUS_ROLLED_BACK);
triggerAfterCompletion(status, TransactionSynchronization.STATUS_UNKNOWN); throw ex; triggerAfterCompletion(status, TransactionSynchronization.STATUS_ROLLED_BACK);
triggerAfterCompletion(status, TransactionSynchronization.STATUS_UNKNOWN); throw ex; triggerAfterCompletion(status, TransactionSynchronization.STATUS_ROLLED_BACK);
triggerAfterCompletion(status, TransactionSynchronization.STATUS_ROLLED_BACK); throw ex; triggerAfterCompletion(status, TransactionSynchronization.STATUS_UNKNOWN); throw err; triggerAfterCompletion(status, TransactionSynchronization.STATUS_COMMITTED);
triggerAfterCompletion(status, TransactionSynchronization.STATUS_ROLLED_BACK); throw ex; triggerAfterCompletion(status, TransactionSynchronization.STATUS_UNKNOWN); triggerAfterCompletion(status, TransactionSynchronization.STATUS_COMMITTED);
triggerAfterCompletion(status, TransactionSynchronization.STATUS_ROLLED_BACK); throw ex; triggerAfterCompletion(status, TransactionSynchronization.STATUS_UNKNOWN); triggerAfterCompletion(status, TransactionSynchronization.STATUS_COMMITTED);