HHH-8739 - Tracking of JTA Synch registration thread
This commit is contained in:
parent
768d02df4a
commit
9d1563a817
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -93,12 +93,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() {
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue