1 Reply Latest reply on Dec 10, 2008 3:30 PM by cpopetz

    Help with Transactions please?

    markj9

      Is it possible to extend EntityQuery and still use JTA Transactions rather than RESOURCE LOCAL?


      If not, is it possible to extend EntityQuery and make it an EJB3 so that you can use JTA Transactions?


      Is it even possible to make an extended EntityQuery a stateless or stateful ejb3 session bean?


      Do you have to use XA datasources in order to use jta transactions?


      Essentially I'm trying to mark an extended entityquery method as asynchronous and have it use jta transactions so that it can cross multiple database resources; however, I seem to continue to run into transaction issues such as no transaction in progress.  Can anyone offer help?

        • 1. Re: Help with Transactions please?
          cpopetz

          Mark Johnson wrote on Dec 10, 2008 04:50:


          Is it possible to extend EntityQuery and still use JTA Transactions rather than RESOURCE LOCAL?



          EntityQuery doesn't determine the type of transactions it uses.  It uses the seam annotation @Transactional which means it uses jta by default when it is available.  If you specify <transaction:entity-transaction/> it will use resource local transactions.



          Do you have to use XA datasources in order to use jta transactions?


          No, if you declare your data source as <local-tx-datasource> it won't be xa.  If you want to use two non-xa datasources in the same jta tx, you'll need to read this



          Essentially I'm trying to mark an extended entityquery method as asynchronous and have it use jta transactions so that it can cross multiple database resources; however, I seem to continue to run into transaction issues such as no transaction in progress.  Can anyone offer help?


          Can you post some example code?