HHH-8739 - Tracking of JTA Synch registration thread

This commit is contained in:
Steve Ebersole 2013-11-22 15:12:39 -06:00 committed by Brett Meyer
parent 768d02df4a
commit 9d1563a817
4 changed files with 13 additions and 9 deletions

View File

@ -260,6 +260,7 @@ public final class TransactionCoordinatorImpl implements TransactionCoordinator
}
jtaPlatform.registerSynchronization( new RegisteredSynchronization( getSynchronizationCallbackCoordinator() ) );
getSynchronizationCallbackCoordinator().synchronizationRegistered();
synchronizationRegistered = true;
if (isDebugging) {
LOG.debug( "successfully registered Synchronization" );
@ -277,7 +278,6 @@ public final 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

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

View File

@ -93,11 +93,8 @@ 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 ) {
registrationThreadId = Thread.currentThread().getId();
}
public void synchronizationRegistered() {
registrationThreadId = Thread.currentThread().getId();
}
@Override

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();
}