I found the following class
Code:
org.springframework.orm.hibernate.HibernateInterceptor
Is it possible to do something similar if I am not using Spring? it is an EJB3 application.
Currently I have replaced ConnectionProvider by specifying a custom one in the hibernate properties. Unfortunately I cannot see if the session information has been set on the connection or not. Wouldn't want to do it every time a connection is provided as it happens multiple times per transaction.
Does a session hold onto one connection or does it use and release back into the pool?
Does a transaction hold onto one connection or does it use and release back into the pool?
I would imagen that one connection is held onto, at least for a transaction, but would appreciate someone confirming/denying/or explaining this to me.
I got it to work in Glassfish by replacing the DataSource with a custom implementation, the problem is the app has to work on JBoss as well and JBoss does not allow me to replace the DataSource for a local tx.
Any suggestions would be appreciated.