Uploaded image for project: 'Red Hat Fuse'
  1. Red Hat Fuse
  2. ENTESB-18849

Attempts to get / read entities fail when using an external transaction context

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • fuse-7.11-GA
    • fuse-7.10-GA
    • Aries, Hibernate
    • None
    • False
    • None
    • False
    • % %
    • Todo
    • Hide

      Reproducer attached. To test, install a new instance of Fuse/Karaf 7.10 and start it.from the Karaf console, run:

      > feature:install jdbc pax-jdbc-h2 pax-jdbc-config pax-jdbc-pool-dbcp2 jpa hibernate transaction jndi
      > install -s blueprint:file:///{path/to/reproducer}/jpa-jta/src/main/config/h2-xa-datasource.xml
      > install -s mvn:fuse-7-10-jpa-jta/fuse-7-10-jpa-jta/1.0.1-SNAPSHOT
      

      Invoke the exposed endpoint with:

      curl -kv http://localhost:8181/cxf/poc/rest-service/performTestExternalJtaTransaction
      
      Show
      Reproducer attached. To test, install a new instance of Fuse/Karaf 7.10 and start it.from the Karaf console, run: > feature:install jdbc pax-jdbc-h2 pax-jdbc-config pax-jdbc-pool-dbcp2 jpa hibernate transaction jndi > install -s blueprint:file: ///{path/to/reproducer}/jpa-jta/src/main/config/h2-xa-datasource.xml > install -s mvn:fuse-7-10-jpa-jta/fuse-7-10-jpa-jta/1.0.1-SNAPSHOT Invoke the exposed endpoint with: curl -kv http: //localhost:8181/cxf/poc/ rest -service/performTestExternalJtaTransaction

    Description

      When a nested method requiring transaction support (TxType.REQUIRED, txType.MANDATORY) is invoked after calling javax.transaction.TransactionManager::begin(), attempts to create and then read entities within the scope of the second method fail and calling get on the DAO returns null.

      Changing the annotation to txType.REQUIRES_NEW avoids this, but this starts a new transaction context.

      Attachments

        Issue Links

          Activity

            People

              ggrzybek Grzegorz Grzybek
              rhn-support-dhawkins Duane Hawkins
              Petr Pinkas Petr Pinkas
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: