HHH-8739 - Tracking of JTA Synch registration thread

This commit is contained in:
Steve Ebersole 2013-11-22 15:12:39 -06:00
parent c1612fe004
commit 608bdefc9a
4 changed files with 13 additions and 9 deletions

View File

@ -255,6 +255,7 @@ public class TransactionCoordinatorImpl implements TransactionCoordinator {
}
jtaPlatform.registerSynchronization( new RegisteredSynchronization( getSynchronizationCallbackCoordinator() ) );
getSynchronizationCallbackCoordinator().synchronizationRegistered();
synchronizationRegistered = true;
LOG.debug( "successfully registered Synchronization" );
}
@ -270,7 +271,6 @@ public class TransactionCoordinatorImpl implements TransactionCoordinator {
}
public void pulse() {
getSynchronizationCallbackCoordinator().pulse();
if ( transactionFactory().compatibleWithJtaSynchronization() ) {
// the configured transaction strategy says it supports callbacks via JTA synchronization, so attempt to
// register JTA synchronization if possible

View File

@ -57,7 +57,6 @@ public class SynchronizationCallbackCoordinatorNonTrackingImpl implements Synchr
public SynchronizationCallbackCoordinatorNonTrackingImpl(TransactionCoordinator transactionCoordinator) {
this.transactionCoordinator = transactionCoordinator;
reset();
pulse();
}
public void reset() {
@ -152,7 +151,7 @@ public class SynchronizationCallbackCoordinatorNonTrackingImpl implements Synchr
}
@Override
public void pulse() {
public void synchronizationRegistered() {
}
@Override

View File

@ -92,12 +92,9 @@ public class SynchronizationCallbackCoordinatorTrackingImpl extends Synchronizat
}
@Override
public void pulse() {
// If this is the first call to pulse since an earlier call to reset, capture the current thread id
if ( registrationThreadId == NO_THREAD_ID ) {
public void synchronizationRegistered() {
registrationThreadId = Thread.currentThread().getId();
}
}
@Override
public void processAnyDelayedAfterCompletion() {

View File

@ -32,6 +32,14 @@ public interface SynchronizationCallbackCoordinator extends Synchronization {
public void setExceptionMapper(ExceptionMapper exceptionMapper);
public void setManagedFlushChecker(ManagedFlushChecker managedFlushChecker);
public void setAfterCompletionAction(AfterCompletionAction afterCompletionAction);
public void pulse();
/**
* A callback whenever a JTA Synchronization is registered
*/
public void synchronizationRegistered();
/**
* A callback to perform any delayed afterCompletion processes
*/
public void processAnyDelayedAfterCompletion();
}