2 Replies Latest reply on Aug 11, 2010 1:46 PM by mbasnight

    factory_class for jta resource?

    mbasnight

      Hey all, im trying to configure JPA (using hibernate) with JTA to a mysql jndi Datasource. I have it working for everything but rollbacks. In order to do this, i set                 hibernate.transaction.factory_class=org.hibernate.transaction.JTATransactionFactory in jpaProperties map in my entityManagerFactory. This causes a warning message in the servicemix logs along the lines of "could not enlist in TX, dont override the factory_class". Without setting the factory_class i get "The chosen transaction strategy requires access to the JTA TransactionManager". Any suggestions or resources for this? Attached are my sources.

       

      Is this even close to the right place to ask a Q like this?? If not where should i go ask? Any help would be appreciated

       

      Edited by: mbasnight on Aug 10, 2010 2:11 PM -- Added the xml files

        • 1. Re: factory_class for jta resource?
          mbasnight

          So i talked to the hibernate crew, and they advised me NOT to set the factory_class. I instead set the lookup_class. The lookup classes extend from a JNDI class, so i exposed the proper values from the source of the class i decided to use. I might in the future use a custom class in case the values for the supplied class ever change.

           

          So remove the lookup_class from the jpa-persistence.xml jpaProperties, and add this instead to the jpaProperties,

           

          hibernate.transaction.manager_lookup_class => org.hibernate.transaction.JBossTransactionManagerLookup

           

          and in the jndi.xml, i added these to accommodate the JBossTransactionManagerLookup,

           

           

           

          Then it works... kind-of. Transactions still dont roll back, but i dont get any warnings and things seemingly are configured correctly. Im wading thru spring/hibernate/fusesource(geronimo TX Mgr)/ and i will hope to update sometime in the future

          • 2. Re: factory_class for jta resource?
            mbasnight

            I still have a problem, but it does not pertain to this question, which i solved. I will post with the new question in a new thread