Announcement Announcement Module
Collapse
No announcement yet.
Upgrading for Hibernate 3 to Hibernate 4 Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Upgrading for Hibernate 3 to Hibernate 4

    Hi All,
    We recently upgraded from Hibernate 3 to Hibernate 4. We are using Spring 3.2.0 M1 with Hibernate. Initially we were setting Hibernate properties as

    Code:
    <prop key="hibernate.transaction.factory_class">com.atomikos.icatch.jta.hibernate3.AtomikosJTATransactionFactory</prop>
    <prop key="hibernate.transaction.manager_lookup_class">com.atomikos.icatch.jta.hibernate3.TransactionManagerLookup</prop>
    But after upgrading to Hibernate4,

    Code:
    <prop key="hibernate.transaction.factory_class">org.hibernate.transaction.CMTTransactionFactory</prop>
    Can anyone here please tell me for the property "hibernate.transaction.manager_lookup_class" what corresponding class should I set?

    Thanks,
    Vivekanand Alampally..

  • #2
    I posted this topic in official Hibernate & atomikos forums

    https://forum.hibernate.org/viewtopic.php?f=1&t=1016892

    http://fogbugz.atomikos.com/default....unity.6.2843.1

    Comment


    • #3
      Help

      I am not able to use Hibernate 4, Atomikos and Spring ...
      How was the property of the JPA settings?
      I already tried many different way but not working:
      My last was:
      Code:
      <property name="jpaProperties">
             		<props>
             			<prop key="hibernate.current_session_context_class">jta</prop>
                  	<prop key="hibernate.connection.provider_class">com.forj.cirrus.infra.hibernate.CirrusConnectionProvider</prop>
                  	<prop key="hibernate.transaction.jta.platform">com.atomikos.icatch.jta.hibernate3.AtomikosJTATransactionFactory</prop>
                  	<prop key="hibernate.transaction.manager_lookup_class">com.atomikos.icatch.jta.hibernate3.TransactionManagerLookup</prop>
               </props>
      Its generate the following error:
      Code:
      java.lang.NullPointerException
      	at org.hibernate.engine.transaction.internal.jta.CMTTransactionFactory.isJoinableJtaTransaction(CMTTransactionFactory.java:63)
      	at org.hibernate.engine.transaction.internal.jta.CMTTransactionFactory.isJoinableJtaTransaction(CMTTransactionFactory.java:39)
      	at org.hibernate.engine.transaction.internal.TransactionCoordinatorImpl.isTransactionJoinable(TransactionCoordinatorImpl.java:295)
      	at org.hibernate.ejb.AbstractEntityManagerImpl.joinTransaction(AbstractEntityManagerImpl.java:1205)
      	at org.hibernate.ejb.AbstractEntityManagerImpl.postInit(AbstractEntityManagerImpl.java:178)
      	at org.hibernate.ejb.EntityManagerImpl.<init>(EntityManagerImpl.java:89)
      	at org.hibernate.ejb.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:179)
      	at org.hibernate.ejb.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:174)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:601)
      	at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.invokeProxyMethod(AbstractEntityManagerFactoryBean.java:376)
      	at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean$ManagedEntityManagerFactoryInvocationHandler.invoke(AbstractEntityManagerFactoryBean.java:517)
      	at sun.proxy.$Proxy38.createEntityManager(Unknown Source)
      	at org.springframework.orm.jpa.EntityManagerFactoryUtils.doGetTransactionalEntityManager(EntityManagerFactoryUtils.java:200)
      	at org.springframework.orm.jpa.SharedEntityManagerCreator$SharedEntityManagerInvocationHandler.invoke(SharedEntityManagerCreator.java:211)
      	at sun.proxy.$Proxy39.find(Unknown Source)
      Could you help me? How do you solve?
      Best Regards.

      Comment


      • #4
        I tried to used:

        Code:
        <property name="jpaProperties">
                       <props>
                           <prop key="hibernate.transaction.manager_lookup_class">com.atomikos.icatch.jta.hibernate3.TransactionManagerLookup</prop>
                 </props>
        And generated the following error:
        Code:
        Fev 15, 2013 11:22:51 AM com.atomikos.logging.JULLogger logWarning
        WARNING: XA resource 'jdbc/intranet': resume for XID '696E7472616E65743230303030313030303236:696E7472616E65743231' raised -8: the supplied XID already exists in this XA resource
        javax.transaction.xa.XAException: XAER_DUPID: The XID identifies an existing transaction.
        	at net.sourceforge.jtds.jdbc.XASupport.raiseXAException(XASupport.java:677)
        	at net.sourceforge.jtds.jdbc.XASupport.xa_start(XASupport.java:191)
        	at net.sourceforge.jtds.jdbcx.JtdsXAResource.start(JtdsXAResource.java:105)
        	at com.atomikos.datasource.xa.XAResourceTransaction.resume(XAResourceTransaction.java:498)
        	at com.atomikos.datasource.xa.session.BranchEnlistedStateHandler.<init>(BranchEnlistedStateHandler.java:59)
        	at com.atomikos.datasource.xa.session.NotInBranchStateHandler.checkEnlistBeforeUse(NotInBranchStateHandler.java:65)
        	at com.atomikos.datasource.xa.session.TransactionContext.checkEnlistBeforeUse(TransactionContext.java:88)
        	at com.atomikos.datasource.xa.session.SessionHandleState.notifyBeforeUse(SessionHandleState.java:179)
        	at com.atomikos.jdbc.AtomikosConnectionProxy.enlist(AtomikosConnectionProxy.java:208)
        Do you know how I can solve?
        Regards.
        Last edited by Fernando Franzini; Feb 15th, 2013, 09:30 AM.

        Comment

        Working...
        X