WebSphereUowTransactionManager sets timeout for actual transaction only

Closes gh-25132
This commit is contained in:
Juergen Hoeller
2020-05-26 23:34:36 +02:00
parent dfa948c2ca
commit 1dea55dc20

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2019 the original author or authors. * Copyright 2002-2020 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -295,14 +295,14 @@ public class WebSphereUowTransactionManager extends JtaTransactionManager
SuspendedResourcesHolder suspendedResources = (!joinTx ? suspend(null) : null); SuspendedResourcesHolder suspendedResources = (!joinTx ? suspend(null) : null);
UOWActionAdapter<T> action = null; UOWActionAdapter<T> action = null;
try { try {
if (def.getTimeout() > TransactionDefinition.TIMEOUT_DEFAULT) { boolean actualTransaction = (uowType == UOWManager.UOW_TYPE_GLOBAL_TRANSACTION);
if (actualTransaction && def.getTimeout() > TransactionDefinition.TIMEOUT_DEFAULT) {
uowManager.setUOWTimeout(uowType, def.getTimeout()); uowManager.setUOWTimeout(uowType, def.getTimeout());
} }
if (debug) { if (debug) {
logger.debug("Invoking WebSphere UOW action: type=" + uowType + ", join=" + joinTx); logger.debug("Invoking WebSphere UOW action: type=" + uowType + ", join=" + joinTx);
} }
action = new UOWActionAdapter<>( action = new UOWActionAdapter<>(def, callback, actualTransaction, !joinTx, newSynch, debug);
def, callback, (uowType == UOWManager.UOW_TYPE_GLOBAL_TRANSACTION), !joinTx, newSynch, debug);
uowManager.runUnderUOW(uowType, joinTx, action); uowManager.runUnderUOW(uowType, joinTx, action);
if (debug) { if (debug) {
logger.debug("Returned from WebSphere UOW action: type=" + uowType + ", join=" + joinTx); logger.debug("Returned from WebSphere UOW action: type=" + uowType + ", join=" + joinTx);