-->
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.  [ 7 posts ] 
Author Message
 Post subject: Hibernate XAResource for JTA transaction management
PostPosted: Tue Sep 27, 2016 10:36 am 
Newbie

Joined: Tue Sep 27, 2016 10:26 am
Posts: 5
Can we get the XAResource implementation of the hibernate for integrating the hibernate transaction in the scope of the jta transaction. Trying to make the hibernate transaction is the part of jta transaction of the core java application (JTA transaction manager is implemented in the core java application).


Top
 Profile  
 
 Post subject: Re: Get XAResource for the jta transaction management
PostPosted: Tue Sep 27, 2016 11:25 am 
Hibernate Team
Hibernate Team

Joined: Thu Sep 11, 2014 2:50 am
Posts: 1628
Location: Romania
Hibernate, just like any JPA provider, supports JTA transactions. You need to provide a JTA DataSource and mark the appropriate transaction type to JTA.

Check out this GitHub example for more details.


Top
 Profile  
 
 Post subject: Re: Hibernate XAResource for JTA transaction management
PostPosted: Wed Sep 28, 2016 2:09 am 
Newbie

Joined: Tue Sep 27, 2016 10:26 am
Posts: 5
Thanks for the reply.

The JTA Transaction manager is already implemented in my application for the jms and data base. Now i am planning to use hibernate for the database. Since the jta transaction is not implemented in the scope of hiberante, how can we make the hibernate transaction as the part of my application's jta transaction.
how can i enlist the hibernate transaction to my application's jta transaction.


Top
 Profile  
 
 Post subject: Re: Hibernate XAResource for JTA transaction management
PostPosted: Wed Sep 28, 2016 2:46 am 
Hibernate Team
Hibernate Team

Joined: Thu Sep 11, 2014 2:50 am
Posts: 1628
Location: Romania
You just need to set the hibernate.transaction.jta.platform configuration property according to the underlying Transaction Manager type (Atomikos, Bitronix, Weblogic, Glassfish, etc).

Code:
<property name="hibernate.transaction.jta.platform" value="org.hibernate.service.jta.platform.internal.JBossStandAloneJtaPlatform" />


Then, you need to configure Hibernate to use the appropriate Datasource provided by your application server:

Code:
<property name="hibernate.connection.datasource" value="java:comp/env/jdbc/DsWebAppDB"/>


Top
 Profile  
 
 Post subject: Re: Hibernate XAResource for JTA transaction management
PostPosted: Wed Sep 28, 2016 9:43 am 
Newbie

Joined: Tue Sep 27, 2016 10:26 am
Posts: 5
Thanks for your reply.

Currently i am not using any application server. It is a standalone java application. The jboss narayana transaction manager is implemented in my application. how can i use my jboss transaction manager for the hibernate. can i integrate the third party transaction manager in hibernate. if it is possible, please reply with the configuration for the same (please specify the config file name also).


Top
 Profile  
 
 Post subject: Re: Hibernate XAResource for JTA transaction management
PostPosted: Wed Sep 28, 2016 9:48 am 
Hibernate Team
Hibernate Team

Joined: Thu Sep 11, 2014 2:50 am
Posts: 1628
Location: Romania
I just did. Check my previous message which actually applies to Narayana since JBossStandAloneJtaPlatform is not the standalone TM.


Top
 Profile  
 
 Post subject: Re: Hibernate XAResource for JTA transaction management
PostPosted: Thu Sep 29, 2016 3:51 am 
Newbie

Joined: Tue Sep 27, 2016 10:26 am
Posts: 5
Thanks for your reply.

The JBoss narayana transaction manager is not working with hibernate. It seems that, the transaction manager is bounded with the hibernate transaction. but when the commit operation is invoked, the data is not getting posted to db.

Please help


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

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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.