-->
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.  [ 3 posts ] 
Author Message
 Post subject: Transaction Committing
PostPosted: Thu Apr 01, 2010 2:36 am 
Newbie

Joined: Thu Apr 01, 2010 2:22 am
Posts: 4
HI,

My Current Application is using
JBoss 4.0.5
Hibernate 3.0
Spring 2.5
Oracle 10g

In the AS we are using both Hibernate and Normal SQL (both in CMT).
Now i had a problem in committing.
I need to commit only Hibernate transaction.

1) Is it Possible?
2) Other than nested transaction?
Thanks in Advance

Regards
Baskar


Top
 Profile  
 
 Post subject: Re: Transaction Committing
PostPosted: Thu Apr 01, 2010 2:55 am 
Expert
Expert

Joined: Tue Jun 16, 2009 3:36 am
Posts: 990
In order to can answer, you must first tell which transaction-factory you configure for hibernate,
if plain JDBCTransactionfactory (=default) or JTA- or CMT-Transactionfactory.
If you use JDBCTransactionfactory then a commit in hibernate should just commit the hibernate transaction.
Quote:
(both in CMT).


OK, If you use CMT (which uses JTA) with a global transaction then the thing is probably a little bit more complicate,
but also here it should be possible to separate the transactions.
I think it should possible by suspending the current transaction over the suspend method
Code:
getTransactionManager().suspend();

Then you should be free to initialize a separate new (global) transaction (either for hibernate or your Normal SQL environment ).
(Unfortunately I'm not an expert of CMT, so take my hints not to serious.)


Top
 Profile  
 
 Post subject: Re: Transaction Committing
PostPosted: Thu Apr 01, 2010 3:11 am 
Newbie

Joined: Thu Apr 01, 2010 2:22 am
Posts: 4
We are using the below configuration

Code:
<property name="hibernate.dialect">org.hibernate.dialect.Oracle9Dialect</property>
<property name="hibernate.transaction.manager_lookup_class">org.hibernate.transaction.JBossTransactionManagerLookup</property>
<property name="hibernate.transaction.factory_class">org.hibernate.transaction.CMTTransactionFactory</property>
<property name="hibernate.connection.release_mode">auto</property>


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.