Skip to content

Commit 2010956

Browse files
committed
WebSphereUowTransactionManager sets timeout for actual transaction only
Closes gh-25225
1 parent 9c73023 commit 2010956

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

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

Lines changed: 5 additions & 5 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.
@@ -282,14 +282,14 @@ else if (pb == TransactionDefinition.PROPAGATION_NOT_SUPPORTED) {
282282
SuspendedResourcesHolder suspendedResources = (!joinTx ? suspend(null) : null);
283283
UOWActionAdapter<T> action = null;
284284
try {
285-
if (definition.getTimeout() > TransactionDefinition.TIMEOUT_DEFAULT) {
285+
boolean actualTransaction = (uowType == UOWManager.UOW_TYPE_GLOBAL_TRANSACTION);
286+
if (actualTransaction && definition.getTimeout() > TransactionDefinition.TIMEOUT_DEFAULT) {
286287
this.uowManager.setUOWTimeout(uowType, definition.getTimeout());
287288
}
288289
if (debug) {
289290
logger.debug("Invoking WebSphere UOW action: type=" + uowType + ", join=" + joinTx);
290291
}
291-
action = new UOWActionAdapter<T>(
292-
definition, callback, (uowType == UOWManager.UOW_TYPE_GLOBAL_TRANSACTION), !joinTx, newSynch, debug);
292+
action = new UOWActionAdapter<T>(definition, callback, actualTransaction, !joinTx, newSynch, debug);
293293
this.uowManager.runUnderUOW(uowType, joinTx, action);
294294
if (debug) {
295295
logger.debug("Returned from WebSphere UOW action: type=" + uowType + ", join=" + joinTx);
@@ -308,7 +308,7 @@ else if (pb == TransactionDefinition.PROPAGATION_NOT_SUPPORTED) {
308308
}
309309
catch (UOWActionException ex) {
310310
TransactionSystemException tse =
311-
new TransactionSystemException("UOWManager threw unexpected UOWActionException", ex);
311+
new TransactionSystemException("UOWManager transaction processing failed", ex);
312312
Throwable appEx = action.getException();
313313
if (appEx != null) {
314314
logger.error("Application exception overridden by rollback exception", appEx);

0 commit comments

Comments
 (0)