Wow, you guys are quick on the response, that is great. So I actually found the issue and have it working now. The code that calls afterTransactionCompletion( false, null ) is in org.hibernate.jdbc.JDBCContext which is getting called from a org.hibernate.transaction.JDBCTransaction
Seeing that our configuration was creating JDBCTransaction's got me thinking, this should be using JTATransaction instead. So I tracked it back to our Hibernate/Spring configuration.
In hibernate.properties we had:
Code:
hibernate.transaction.manager_lookup_class=org.springframework.orm.hibernate3.LocalTransactionManagerLookup
hibernate.transaction.factory_class=org.springframework.orm.hibernate3.SpringTransactionFactory
SpringTransactionFactory always uses JDBCTransaction instead of JTATransaction so I looked into replacing this. Looking through the forum I found a similar post that recommends the following configuration for Bitronix:
Code:
hibernate.transaction.manager_lookup_class=org.hibernate.transaction.BTMTransactionManagerLookup
hibernate.transaction.factory_class=org.hibernate.transaction.JTATransactionFactory
These didn't quite fit what we needed because we're not using JNDI and both of these depend on some form of JNDI configuration. So I extended both of these to remove the JNDI requirements.
NonJndiBtmTransactionManagerLookup
Code:
public class NonJndiBtmTransactionManagerLookup extends BTMTransactionManagerLookup {
public String getUserTransactionName() {
return null;
}
}
NonJndiBtmJTATransactionFactory
Code:
public class NonJndiBtmJTATransactionFactory extends JTATransactionFactory {
@SuppressWarnings("unchecked")
protected UserTransaction getUserTransaction() {
try {
Class clazz = Class.forName("bitronix.tm.TransactionManagerServices");
return (UserTransaction) clazz.getMethod("getTransactionManager", null).invoke(null, null);
}
catch (Exception e) {
throw new HibernateException( "Could not obtain BTM transaction manager instance", e );
}
}
}
Now with these in place JTATransaction's are being created and the FullTextIndexEventListener is getting the proper Status and updating the index as expected. Hopefully this helps someone else out there. Thanks guys for your input!