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

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major 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

      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.

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

                Created:
                Updated:
                Resolved: