-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Hibernate using Spring managed JTA transactions
PostPosted: Wed Aug 02, 2006 8:51 am 
Newbie

Joined: Wed Aug 02, 2006 8:35 am
Posts: 1
Hi,

I'm using Hibernate with Spring managet JTA Transactions in Weblogic server. If I call an empty service-layer method from web-layer, one JTA transaction is created, as expected(PROPAGATION_REQUIRED). But if this method calls getHibernateTemplate().find("...), 4 transactions are created. So my problem is figuring out and eliminate the 3 additional transactions. My wish is that hibernate session would run in current transaction, which was created at the first place.

Any help or advice is appriciated.
Thank you.

My Transaction manager:
Code:
<bean id="transactionManager"
   class="org.springframework.transaction.jta.JtaTransactionManager">
   <property name="userTransactionName" value="java:comp/UserTransaction"/>
</bean>


Hibernate session factory:
Code:
<bean id="sessionFactory" depends-on="cacheManager"
   class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
   <property name="dataSource" ref="dataSource"/>
   <property name="mappingLocations" value="classpath*:mappings/*.hbm.xml"/>
   <property name="hibernateProperties">
      <props>
         <prop key="hibernate.dialect">org.hibernate.dialect.OracleDialect</prop>
         <prop key="hibernate.show_sql">false</prop>
         <prop key="hibernate.cache.use_minimal_puts">true</prop>
         <prop key="hibernate.hibernate.cache.provider_class">
            org.hibernate.cache.EhCacheProvider
         </prop>
         <prop key="hibernate.query.factory_class">
      org.hibernate.hql.classic.ClassicQueryTranslatorFactory
         </prop>
      </props>
   </property>
</bean>


Interceptor:

Code:
<bean id="transactionInterceptor"
   class="org.springframework.transaction.interceptor.TransactionInterceptor">
   <property name="transactionManager" ref="transactionManager" />
   <property name="transactionAttributes">
      <props>
         <prop key="*">PROPAGATION_REQUIRED</prop>
      </props>
   </property>
</bean>


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.