Author: steve.ebersole(a)jboss.com
Date: 2008-02-06 21:08:56 -0500 (Wed, 06 Feb 2008)
New Revision: 14315
Modified:
core/branches/Branch_3_2/src/org/hibernate/jdbc/JDBCContext.java
Log:
HHH-1956 : Interceptor.afterTransactionCompletion() and JTA
Modified: core/branches/Branch_3_2/src/org/hibernate/jdbc/JDBCContext.java
===================================================================
--- core/branches/Branch_3_2/src/org/hibernate/jdbc/JDBCContext.java 2008-02-07 02:08:26
UTC (rev 14314)
+++ core/branches/Branch_3_2/src/org/hibernate/jdbc/JDBCContext.java 2008-02-07 02:08:56
UTC (rev 14315)
@@ -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