8 Replies Latest reply on Dec 7, 2006 6:27 AM by Juha Moisio

    recoveryExtension

    Juha Moisio Newbie

      Hi,

      I have configured two datasources to same mysql database.
      One is local tx and the other is xa.

      Some of beans are using local tx datasource because
      they only do database operations.

      Two beans are making both database and jms operations
      so they are using xa datasource.

      Two persistence units are configured in persistence.xml

      <persistence>
      
       <persistence-unit name="MessageServer" transaction-type="jta">
      
       <provider>org.hibernate.ejb.HibernatePersistence</provider>
       <jta-data-source>java:/MessageServicesDS</jta-data-source>
      
       <properties>
       <property name="hibernate.dialect">org.hibernate.dialect.MySQLInnoDBDialect</property>
       <!-- property name="hibernate.hbm2ddl.auto" value="create"/ -->
       <property name="hibernate.session_factory_name" value="ServiceConfig"/>
       <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup"/>
       <property name="hibernate.jdbc.use_get_generated_keys" value="true"/>
       <property name="hibernate.order_updates" value="true"/>
       <property name="hibernate.jdbc.batch_versioned_data" value="true"/>
       <property name="jta.UserTransaction" value="UserTransaction"/>
       <property name="hibernate.current_session_context_class" value="jta"/>
       <property name="hibernate.query.jpaql_strict_compliance" value="false"/>
       <property name="hibernate.show_sql" value="false"/>
       <property name="hibernate.format_sql" value="true"/>
       <property name="jboss.entity.manager.factory.jndi.name" value="java:/EntityManagerFactory"/>
       <property name="jboss.entity.manager.jndi.name" value="java:/EntityManager"/>
       </properties>
      
       <!-- property name="hibernate.ejb.cfgfile" value="/hibernate.cfg.xml"/ -->
       </persistence-unit>
      
       <persistence-unit name="MessageServerXA" transaction-type="jta">
      
       <provider>org.hibernate.ejb.HibernatePersistence</provider>
       <jta-data-source>java:/MessageServicesXADS</jta-data-source>
      
       <properties>
       <property name="hibernate.dialect">org.hibernate.dialect.MySQLInnoDBDialect</property>
       <property name="hibernate.session_factory_name" value="ServiceConfig2"/>
       <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup"/>
       <property name="hibernate.jdbc.use_get_generated_keys" value="true"/>
       <property name="hibernate.order_updates" value="true"/>
       <property name="hibernate.jdbc.batch_versioned_data" value="true"/>
       <property name="jta.UserTransaction" value="UserTransaction"/>
       <property name="hibernate.current_session_context_class" value="jta"/>
       <property name="hibernate.query.jpaql_strict_compliance" value="false"/>
       <property name="hibernate.show_sql" value="false"/>
       <property name="hibernate.format_sql" value="true"/>
       <property name="jboss.entity.manager.factory.jndi.name" value="java:/EntityManagerFactory2"/>
       <property name="jboss.entity.manager.jndi.name" value="java:/EntityManager2"/>
       </properties>
      
       </persistence-unit>
      
      
      </persistence>
      



      Datasource is selected using

      @PersistenceContext(unitName = "MessageServerXA")
      private EntityManager entityManager;
      
      or
      
      @PersistenceContext(unitName = "MessageServer")
      private EntityManager entityManager;
      


      Which recovery extensions have to be enabled in jbossjts-properties.xml?

       <property
       name="com.arjuna.ats.arjuna.recovery.recoveryExtension1" value="com.arjuna.ats.internal.arjuna.recovery.AtomicActionRec$
       <property
       name="com.arjuna.ats.arjuna.recovery.recoveryExtension2" value="com.arjuna.ats.internal.txoj.recovery.TORecoveryModule"$
       <property
       name="com.arjuna.ats.arjuna.recovery.recoveryExtension3" value="com.arjuna.ats.internal.jts.recovery.transactions.TopLe$
       <property
       name="com.arjuna.ats.arjuna.recovery.recoveryExtension4" value="com.arjuna.ats.internal.jts.recovery.transactions.Serve$
       <!-- property
       name="com.arjuna.ats.arjuna.recovery.recoveryExtension5"
       value="com.arjuna.ats.internal.jta.recovery.arjunacore.XARecoveryModule"/ -->
      
       <!-- property
       name="com.arjuna.ats.arjuna.recovery.recoveryExtension6"
       value="com.arjuna.ats.internal.jta.recovery.jts.XARecoveryModule"/ -->
      
      


      Br,

      Juha Moisio