Skip to content

Commit

Permalink
WebSphereUowTransactionManager sets timeout for actual transaction only
Browse files Browse the repository at this point in the history
Closes gh-25225
  • Loading branch information
jhoeller committed Jun 10, 2020
1 parent 9c73023 commit 2010956
Showing 1 changed file with 5 additions and 5 deletions.
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -282,14 +282,14 @@ else if (pb == TransactionDefinition.PROPAGATION_NOT_SUPPORTED) {
SuspendedResourcesHolder suspendedResources = (!joinTx ? suspend(null) : null);
UOWActionAdapter<T> action = null;
try {
if (definition.getTimeout() > TransactionDefinition.TIMEOUT_DEFAULT) {
boolean actualTransaction = (uowType == UOWManager.UOW_TYPE_GLOBAL_TRANSACTION);
if (actualTransaction && definition.getTimeout() > TransactionDefinition.TIMEOUT_DEFAULT) {
this.uowManager.setUOWTimeout(uowType, definition.getTimeout());
}
if (debug) {
logger.debug("Invoking WebSphere UOW action: type=" + uowType + ", join=" + joinTx);
}
action = new UOWActionAdapter<T>(
definition, callback, (uowType == UOWManager.UOW_TYPE_GLOBAL_TRANSACTION), !joinTx, newSynch, debug);
action = new UOWActionAdapter<T>(definition, callback, actualTransaction, !joinTx, newSynch, debug);
this.uowManager.runUnderUOW(uowType, joinTx, action);
if (debug) {
logger.debug("Returned from WebSphere UOW action: type=" + uowType + ", join=" + joinTx);
Expand All @@ -308,7 +308,7 @@ else if (pb == TransactionDefinition.PROPAGATION_NOT_SUPPORTED) {
}
catch (UOWActionException ex) {
TransactionSystemException tse =
new TransactionSystemException("UOWManager threw unexpected UOWActionException", ex);
new TransactionSystemException("UOWManager transaction processing failed", ex);
Throwable appEx = action.getException();
if (appEx != null) {
logger.error("Application exception overridden by rollback exception", appEx);
Expand Down

0 comments on commit 2010956

Please sign in to comment.