Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version:
3.0.5 on Websphere 5.1.2
Name and version of the database you are using:
Oracle 9i
Hi,
I'm running an app on Websphere 5.1.2 using Hibernate version 3.0.5.
I'm using an MDB with JTA. Things are going well, except that when I try to manually commit some changes within a transaction, those changes are not committed until the end of the transaction.
I'm using session.flush().
My code is similar to the following:
public void doMethod() {
Session session = HibernateUtil.currentJTASession();
// pass through to sessionFactory.getCurrentSession();
// do queries
// do inserts and updates
session.flush();
// do more stuff
}
The transaction is managed by the container.
my hibernate.properties file is as follows:
# Hibernate TransactionFactory
# 1. delegates to JTA (if an existing transaction is underway the Session performs its
# work in that context, otherwise a new transaction is started)
hibernate.transaction.factory_class = org.hibernate.transaction.JTATransactionFactory
hibernate.transaction.flush_before_completion true
hibernate.transaction.auto_close_session true
jta.UserTransaction=jta/usertransaction
#jta.UserTransaction=java:comp/UserTransaction
# Hibernate Transaction Manager Lookup Class
hibernate.transaction.manager_lookup_class = org.hibernate.transaction.WebSphereTransactionManagerLookup
#hibernate.transaction.manager_lookup_class = org.hibernate.transaction.WebSphereExtendedJTATransactionLookup
Any help would be appreciated.
-Ben