Uploaded image for project: 'Spring Framework'
  1. Spring Framework
  2. SPR-15749

Inconsistent treatment of Errors by CallbackPreferringPlatformTransactionManager

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 4.3.9
    • Fix Version/s: Waiting for Triage
    • Component/s: Transaction
    • Labels:
      None
    • Last commented by a User:
      true

      Description

      Most places in spring-tx treat RuntimeException and Error equally rolling back in both cases as both of them are unchecked. This can be seen in TransactionAspectSupport. completeTransactionAfterThrowing and DefaultTransactionAttribute. rollbackOn

      The execution path for CallbackPreferringPlatformTransactionManager seems to be different
      https://github.com/spring-projects/spring-framework/blob/master/spring-tx/src/main/java/org/springframework/transaction/interceptor/TransactionAspectSupport.java#L319
      where an Error is not thrown but instead wrapped in a ThrowableHolderException. However looking at the code in UOWActionAdapter.run (used by the only present implementation of CallbackPreferringPlatformTransactionManager) any kind of Throwable seems to cause a rollback. It seems to me as if RuntimeException and Error should be treated equally in the CallbackPreferringPlatformTransactionManager path in TransactionAspectSupport.java

        Attachments

          Activity

            People

            Assignee:
            juergen.hoeller Juergen Hoeller
            Reporter:
            marschall Philippe Marschall
            Last updater:
            Spring Issues
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Days since last comment:
              2 years, 6 weeks, 6 days ago