-->
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: flush on commit not working with JTA
PostPosted: Thu Mar 16, 2006 6:14 pm 
Newbie

Joined: Thu Mar 16, 2006 4:27 pm
Posts: 2
Hibernate version: 3.1.2
Mapping document Relevant part:

<!-- Transaction specific settings -->
<property name="hibernate.transaction.factory_class">org.hibernate.transaction.JTATransactionFactory</property>
<property name="hibernate.transaction.manager_lookup_class">org.hibernate.transaction.WeblogicTransactionManagerLookup</property>
<property name="jta.UserTransaction">javax/transaction/UserTransaction</property>
<property name="hibernate.current_session_context_class">jta</property>
<property name="hibernate.transaction.flush_before_completion">true</property>
<property name="hibernate.transaction.auto_close_session">true</property>
Name and version of the database you are using: MSSQL Server 2000
App Server Weblogic 8.1 SP5, no EJBs

When commiting a hibernate transaction that was not started by Hibernate, no flush is occuring when hbTransaction.commit() is called even though hibernate.transaction.flush_before_completion is set to true (confirmed in the log file as well). Only executing hbTransaction.flush() makes the flush happen within the try/catch block. Flush does occur when the JTA transaction is being commited though, but it is too late to handle an error at that point.

The strange thing is that hibernate transaction does commit according to this log entry:
<DEBUG> org.hibernate.transaction.JTATransaction.commit(129) [commit]
but no flush...

the code looks essentially like this:
try{
hbSession.getCurrentSession();
hbTransaction = hbSession.getTransaction();
hbSession.update(...);
hbTransaction.commit();
} catch (Exception e){
hbTransaction.rollback();
} finally {
hbSession.close();
}

Question 1 : Is this expected behavior?
Question 2 : Could this be in any way related to Weblogic's JTA implementation?

Any insight is greatly appreciated


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.