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
|