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

Transaction not marked RollbackOnly when @Transactional annotated via @Stereotype

Attach filesAttach ScreenshotAdd voteVotersWatch issueWatchersCreate sub-taskConvert to sub-taskLinkCloneLabelsUpdate Comment AuthorReplace String in CommentUpdate Comment Visibility
    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

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              Kaminfeuer Frank Jung

              Dates

              • Created:
                Updated:

                Issue deployment