connection « Interceptor « JPA Q&A





3. Getting the session connection from within the interceptor    forum.hibernate.org

I'm trying to implement a history/logger interceptor where the log entries are applied in the same transaction as the changes. This is covered in previous posts. How can I get a reference to the 'current' Session's connection from inside an Interceptor callback? Obviously I could pass it in in the constructor, or a setter method, however these are not ideal. I ...