Can I access the primary Hibernate Session from beforeTransactionCompletion?
I have implemented a custom TransactionInterceptor (which extends
org.hibernate.EmptyInterceptor) in which I override
beforeTransactionCompletion(Transaction tx).
I have configured it (as part of my persistence unit)...
<property name="hibernate.ejb.interceptor"
value="com.company.persistence.MyTransactionInterceptor"/>
In doing a bit of debugging, I noticed that the Hibernate Session used in
beforeTransactionCompletion is an altogether different session than the
one used as part of the primary transaction (which is a problem because I
want to access the managed objects held by the primary session in
beforeTransactionCompletion).
With that said, is there any way to access the primary session in
beforeTransactionCompletion?
Some specifics regarding my environment...
Hibernate 3.3.1.GA
Spring Framework 2.5.5
JBoss 5.1.0.GA
Java 1.6.0_25
No comments:
Post a Comment