Skip to content

Commit

Permalink
OGM-1229 Initialize the OperationCollector on pulse()
Browse files Browse the repository at this point in the history
ORM used to initialize a TransactionImpl when initializing the
SessionImpl but it now only calls pulse() on the TransactionCoordinator.
Thus, the OperationCollector initialization must be moved there.
  • Loading branch information
gsmet committed Feb 6, 2018
1 parent bb168d8 commit b917002
Showing 1 changed file with 3 additions and 2 deletions.
Expand Up @@ -15,6 +15,7 @@
* A {@link TransactionCoordinator} invoking the registered {@link ErrorHandler} upon rollbacks.
*
* @author Gunnar Morling
* @author Guillaume Smet
*/
public class ErrorHandlerEnabledTransactionCoordinatorDecorator extends ForwardingTransactionCoordinator {

Expand All @@ -35,14 +36,14 @@ public OperationCollector getOperationCollector() {
}

@Override
public TransactionDriver getTransactionDriverControl() {
public void pulse() {
// Create the collector upon first usage in a given TX (not done via TransactionObserver#afterBegin() as it is
// not invoked in the case of JTA
if ( operationCollector == null ) {
operationCollector = new OperationCollector( errorHandler );
}

return super.getTransactionDriverControl();
super.pulse();
}

/**
Expand Down

0 comments on commit b917002

Please sign in to comment.