From b2916392fa03879a7338d61bb46e37c4d66e2d29 Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Tue, 26 May 2020 23:34:36 +0200 Subject: [PATCH] WebSphereUowTransactionManager sets timeout for actual transaction only Closes gh-25132 --- .../transaction/jta/WebSphereUowTransactionManager.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/spring-tx/src/main/java/org/springframework/transaction/jta/WebSphereUowTransactionManager.java b/spring-tx/src/main/java/org/springframework/transaction/jta/WebSphereUowTransactionManager.java index 30ae675c6b5f..ff330baf09d7 100644 --- a/spring-tx/src/main/java/org/springframework/transaction/jta/WebSphereUowTransactionManager.java +++ b/spring-tx/src/main/java/org/springframework/transaction/jta/WebSphereUowTransactionManager.java @@ -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. @@ -297,14 +297,14 @@ else if (pb == TransactionDefinition.PROPAGATION_NOT_SUPPORTED) { SuspendedResourcesHolder suspendedResources = (!joinTx ? suspend(null) : null); UOWActionAdapter action = null; try { - if (definition.getTimeout() > TransactionDefinition.TIMEOUT_DEFAULT) { + boolean actualTransaction = (uowType == UOWManager.UOW_TYPE_GLOBAL_TRANSACTION); + if (actualTransaction && definition.getTimeout() > TransactionDefinition.TIMEOUT_DEFAULT) { uowManager.setUOWTimeout(uowType, definition.getTimeout()); } if (debug) { logger.debug("Invoking WebSphere UOW action: type=" + uowType + ", join=" + joinTx); } - action = new UOWActionAdapter<>( - definition, callback, (uowType == UOWManager.UOW_TYPE_GLOBAL_TRANSACTION), !joinTx, newSynch, debug); + action = new UOWActionAdapter<>(definition, callback, actualTransaction, !joinTx, newSynch, debug); uowManager.runUnderUOW(uowType, joinTx, action); if (debug) { logger.debug("Returned from WebSphere UOW action: type=" + uowType + ", join=" + joinTx);