-->
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/Spring transaction manager lookup with jbossts
PostPosted: Sat Aug 08, 2009 10:02 pm 
Newbie

Joined: Sat Aug 08, 2009 9:57 pm
Posts: 1
I'm developing a Mule ESB application that uses Hibernate, configured through Spring, in the service component implementations. I'm interested in enlisting inbound jms endpoints, the Hibernate activities occuring in the component, and outbound jms endpoints in an XA transaction. The application will be running in Mule Standalone so I'm using the jbossts integration that Mule provides. I just can't seem to get a handle on the Hibernate configuration (in Spring).

So in my mule config I have this:
<jbossts:transaction-manager />

And I have Mule service components configured essentially like this:
<service name="transactionalService">
<inbound>
<jms:inbound-endpoint ref="input.queue">
<xa-transaction action="BEGIN_OR_JOIN" />
</jms:inbound-endpoint>
</inbound>
<component>
<method-entry-point-resolver>
<include-entry-point method="processMessage" />
</method-entry-point-resolver>
<spring-object bean="messageHandler" />
</component>
<outbound>
<pass-through-router>
<jms:outbound-endpoint ref="input.queue">
<xa-transaction action="ALWAYS_JOIN" />
</jms:outbound-endpoint>
</pass-through-router>
</outbound>
</service>

I'm using Spring to configure Hibernate like this:
<bean id="dataSource" class="oracle.jdbc.xa.client.OracleXADataSource">
<property name="URL" value = "${datasource.url}" />
<property name="user" value="${datasource.username}" />
<property name="password" value="${datasource.password}" />
</bean>

<bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
<property name="dataSource" ref="dataSource" />
<property name="hibernateProperties">
<util:properties location="classpath:application/hibernate.properties" />
</property>
<property name="packagesToScan" value="com.company.project/" />
</bean>

<bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory" ref="sessionFactory" />
<property name="nestedTransactionAllowed" value="true" />
</bean>

<tx:annotation-driven transaction-manager="transactionManager" />


It's this last part with the transactionManager that I know is wrong but I can't figure out exactly how to change this to lookup the TransactionManager that I'm sure is exposed somehow by jbossts. The XA transactions are working on the jms endpoints but the Hibernate persistence within the service component isn't being enlisted in the transaction.

Has anyone done anything similar and can point me in the right direction?

Thanks
Jim


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.