Advertisement

09.28.2007 at 08:40AM PDT, ID: 22859683
[x]
Attachment Details

JTA Transactions Spring, Hibernate in WebSphere

Asked by pratikbm in J2EE Frameworks, IBM Websphere Application Server, J2EE

Tags: transaction, spring, websphere, hibernate, jta

Hi,
I am using Spring, Hibernate and Websphere for an application. I want to use JTA Transaction.
All my transactions are rolled back, I am getting this message - WLTC0032W: One or more local transaction resources were rolled back during the cleanup of a LocalTransactionContainment. I think that Hibernate is starting its own transactions and they are rolled back by Websphere Global Transactions. How do I make Hibernate use Websphere JTA Transactions?
I tried several combinations but I think I am missing something.

Any help would be greatly appreciated.

Configuration is as follows -

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
" http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
<bean id="ccmDataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName" value="ccmds"/>
</bean>
<bean id="mySessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource" ref="ccmDataSource"/>
<property name="mappingResources">
<list>
<value>/web-inf/mapping/Sections.hbm.xml</value>
</list>
</property>

<property name="hibernateProperties">
<value>
org.hibernate.dialect.OracleDialect
</value>
</property>
<!--
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.Oracle9Dialect</prop>
<prop key="hibernate.transaction.factory_class">org.hibernate.transaction.CMTTransactionFactory</prop>
<prop key="hibernate.transaction.manager_lookup">org.hibernate.transaction.WebspherExtendedJTATransactionLookup</prop>
<prop key="hibernate.transaction.flush_before_completion">true</prop>
<prop key="hibernate.transaction.auto_close_session">true</prop>
</props>
</property>
-->
</bean>

<bean id="myTxManager" class="org.springframework.transaction.jta.JtaTransactionManager"/>


<!--
<bean id="wsJta" class="org.springframework.transaction.jta.WebSphereTransactionManagerFactoryBean"/>

<bean id="transactionManager" class="org.springframework.transaction.jta.JtaTransactionManager" >
<property name="userTransactionName"><null /></property>
<property name="transactionManager" ref="wsJta" />
</bean>
-->

<bean id="templateDesignDAO" class="com.ubs.ccm.dao.TemplateDesignDAOImpl">
<property name="sessionFactory" ref="mySessionFactory"/>
</bean>


<bean id="templateDesignService" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
<property name="proxyInterfaces">
<list>
<value>
com.ubs.ccm.dao.TemplateDesignDAO
</value>
</list>
</property>
<property name="target">
<ref bean="templateDesignDAO"/>
</property>
<property name="transactionManager">
<ref bean="myTxManager"/>
</property>
<property name="transactionAttributes">
<props>
<prop key="addSection">
PROPAGATION_REQUIRED,ISOLATION_DEFAULT
</prop>
</props>
</property>
</bean>


</beans>



Start Free Trial
[+][-]10.01.2007 at 06:10AM PDT, ID: 19990481

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.03.2007 at 08:19AM PDT, ID: 20007312

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]12.05.2007 at 11:13AM PST, ID: 20414038

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]12.09.2007 at 05:27PM PST, ID: 20439005

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: J2EE Frameworks, IBM Websphere Application Server, J2EE
Tags: transaction, spring, websphere, hibernate, jta
Sign Up Now!
Solution Provided By: Computer101
Participating Experts: 2
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_1_20070628