Author: steve.ebersole(a)jboss.com
Date: 2008-02-06 21:08:26 -0500 (Wed, 06 Feb 2008)
New Revision: 14314
Modified:
core/trunk/core/src/main/java/org/hibernate/jdbc/JDBCContext.java
Log:
HHH-1956 : Interceptor.afterTransactionCompletion() and JTA
Modified: core/trunk/core/src/main/java/org/hibernate/jdbc/JDBCContext.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/jdbc/JDBCContext.java 2008-02-06 07:46:52
UTC (rev 14313)
+++ core/trunk/core/src/main/java/org/hibernate/jdbc/JDBCContext.java 2008-02-07 02:08:26
UTC (rev 14314)
@@ -163,11 +163,15 @@
else {
javax.transaction.Transaction tx = tm.getTransaction();
if ( JTAHelper.isMarkedForRollback( tx ) ) {
+ // transactions marked for rollback-only cause some TM impls to throw exceptions
log.debug( "Transaction is marked for rollback; skipping Synchronization
registration" );
return false;
}
else {
- tx.registerSynchronization( new CacheSynchronization(owner, this, tx, null) );
+ if ( hibernateTransaction == null ) {
+ hibernateTransaction =
owner.getFactory().getSettings().getTransactionFactory().createTransaction( this, owner
);
+ }
+ tx.registerSynchronization( new CacheSynchronization(owner, this, tx,
hibernateTransaction) );
isTransactionCallbackRegistered = true;
log.debug("successfully registered Synchronization");
return true;
Show replies by date