There seems to be a catch-22 when trying to setup a custom interceptor that needs arguments in it's constructor while also participating in JBoss transactions. I hope I'm wrong. :) Here's what I want to do:
Get a Session from HibernateContext.getSession(), specifying an interceptor in the hibernate-service.xml file using SessionFactoryInterceptor.
However, that interceptor needs to be passed an argument to it's constructor for each Session created.
It'd be great if there was a getSession() that took an interceptor, similar to SessionFactory.openSession().
Oh, yeah. I need to specify the JDBC connection programmatically as well.
Is this possible? :)
One way out might be to specify the hibernate.transaction.factory_class property in hibernate-service.xml, but there's no MBean property for that according to this page:
http://docs.jboss.org/jbossas/jboss4guide/r2/html/ch13.html#ch13.config.table
Help?