Uploaded image for project: 'TomEE'
  1. TomEE
  2. TOMEE-2907

Transaction not marked RollbackOnly when @Transactional annotated via @Stereotype

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 8.0.4
    • Fix Version/s: None
    • Component/s: TomEE Core Server
    • Labels:
      None

      Description

      When calling a bean method annotated with @Transactional, the transaction is marked RollbackOnly if a RuntimeException is thrown from within the method.

      This is not working when wrapping @Transactional into a @Stereotype and using this to mark as transactional.

      Tiny sample project to demonstrate the problem will be attached - call the following URLs after deployment:

      [1] http://localhost:8080/TransStereoDemo/demo/success

      [2] http://localhost:8080/TransStereoDemo/demo/fail

      [3] http://localhost:8080/TransStereoDemo/demo/success2

      [4] http://localhost:8080/TransStereoDemo/demo/fail2

      All above calls will output "COMMIT" or "ROLLBACK" depending on the transaction state.

      [2] will correctly result in "ROLLBACK" (@Transactional annotated directly) while [4] gives "COMMIT" (@Stereotype containing @Transactional is used for annotation)

        Attachments

        1. TransStereoDemo.zip
          6 kB
          Frank Jung

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              Kaminfeuer Frank Jung
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: