Hi' everybody,
We have implemented a custom org.hibernate.Interceptor for handling some tasks before transaction completion. We found that our code could fail and the Exception thrown were lost.
Examining hibernate's sources we found the reason:
SessiomImpl.class
Code:
public void beforeTransactionCompletion(Transaction tx) {
log.trace( "before transaction completion" );
if ( rootSession == null ) {
try {
interceptor.beforeTransactionCompletion(tx);
}
catch (Throwable t) {
log.error("exception in interceptor beforeTransactionCompletion()", t);
}
}
}
Hibernate is hiding our exception and we cannot handle it right. Is there any reason for this? How can we workaround this issue. (We need to know if code failed).
Thank you very much!
Hibernate version: 3.2.0 GA