In a setup using JTASessionContext flush() and close() should occur automatically at the end of the transaction.
This works with hibernate 3.0.5 but does not with hibernate 3.2.0-ga and 3.2.1-ga.
Setup:
hibernate.transaction.manager_lookup_class=org.hibernate.transaction.JBossTransactionManagerLookup
hibernate.current_session_context_class=org.hibernate.context.JTASessionContext
hibernate.transaction.flush_before_completion=true
hibernate.transaction.auto_close_session=true
Usage:
public void doSomeWork() throws Exception {
TransactionManager tm = (TransactionManager) Locator.lookup("java:/TransactionManager");
tm.begin();
Session session = sf.getCurrentSession();
PersistentObject data = new PersistentObject ();
data.setXYZ("xyz");
session.save(data);
tm.commit();
}
Symptom:
no inserts/updates/deletes, only "select xxx.nextval()" occur to the database.
Do you have a setting for 'hibernate.transaction.factory_class'? If not, Hibernate defaults to using JDBC-based transactions (that has not changed...).