Skip to content

Commit b291639

Browse files
committed
WebSphereUowTransactionManager sets timeout for actual transaction only
Closes gh-25132
1 parent ffe08ae commit b291639

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

spring-tx/src/main/java/org/springframework/transaction/jta/WebSphereUowTransactionManager.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2017 the original author or authors.
2+
* Copyright 2002-2020 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -297,14 +297,14 @@ else if (pb == TransactionDefinition.PROPAGATION_NOT_SUPPORTED) {
297297
SuspendedResourcesHolder suspendedResources = (!joinTx ? suspend(null) : null);
298298
UOWActionAdapter<T> action = null;
299299
try {
300-
if (definition.getTimeout() > TransactionDefinition.TIMEOUT_DEFAULT) {
300+
boolean actualTransaction = (uowType == UOWManager.UOW_TYPE_GLOBAL_TRANSACTION);
301+
if (actualTransaction && definition.getTimeout() > TransactionDefinition.TIMEOUT_DEFAULT) {
301302
uowManager.setUOWTimeout(uowType, definition.getTimeout());
302303
}
303304
if (debug) {
304305
logger.debug("Invoking WebSphere UOW action: type=" + uowType + ", join=" + joinTx);
305306
}
306-
action = new UOWActionAdapter<>(
307-
definition, callback, (uowType == UOWManager.UOW_TYPE_GLOBAL_TRANSACTION), !joinTx, newSynch, debug);
307+
action = new UOWActionAdapter<>(definition, callback, actualTransaction, !joinTx, newSynch, debug);
308308
uowManager.runUnderUOW(uowType, joinTx, action);
309309
if (debug) {
310310
logger.debug("Returned from WebSphere UOW action: type=" + uowType + ", join=" + joinTx);

0 commit comments

Comments
 (0)