Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-11629

Transaction service isn't available when dynamically adding transactional annotation

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Do
    • Major
    • None
    • 15.0.1.Final
    • Transactions
    • None

    Description

      When adding dynamically a transactional annotation, transactional module isn't loaded, so transactions aren't available and throws this error:

      javax.persistence.TransactionRequiredException: WFLYJPA0060: Transaction is required to perform this operation (either use a transaction or extended persistence context)
      

      I've attached a reproducer with a test in order to reproduce this. There you can see that there is a CDI producer that dynamically adds the annotation for transactions, that doesn't work.

      mkouba@redhat.com found this could be an optimization for not loading JTS module: https://github.com/wildfly/wildfly/blob/master/transactions/src/main/java/org/jboss/as/txn/deployment/TransactionDependenciesProcessor.java#L74-L76

      In order to execute tests:

      mvn clean test

      To execute test, passing in Payara:

      mvn clean test -Ppayara

      Attachments

        Issue Links

          Activity

            People

              ochaloup@redhat.com Ondrej Chaloupka (Inactive)
              juagonza-1 Juan Gonzalez (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: