Skip to content

Commit a0c86ae

Browse files
committed
WebSphereUowTransactionManager exposes SmartTransactionObject
Issue: SPR-11876 (cherry picked from commit 03f3412)
1 parent 0761ee9 commit a0c86ae

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

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

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2013 the original author or authors.
2+
* Copyright 2002-2014 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.
@@ -35,9 +35,11 @@
3535
import org.springframework.transaction.support.CallbackPreferringPlatformTransactionManager;
3636
import org.springframework.transaction.support.DefaultTransactionDefinition;
3737
import org.springframework.transaction.support.DefaultTransactionStatus;
38+
import org.springframework.transaction.support.SmartTransactionObject;
3839
import org.springframework.transaction.support.TransactionCallback;
3940
import org.springframework.transaction.support.TransactionSynchronization;
4041
import org.springframework.transaction.support.TransactionSynchronizationManager;
42+
import org.springframework.transaction.support.TransactionSynchronizationUtils;
4143
import org.springframework.util.ReflectionUtils;
4244

4345
/**
@@ -308,7 +310,7 @@ else if (pb == TransactionDefinition.PROPAGATION_NOT_SUPPORTED) {
308310
/**
309311
* Adapter that executes the given Spring transaction within the WebSphere UOWAction shape.
310312
*/
311-
private class UOWActionAdapter<T> implements UOWAction {
313+
private class UOWActionAdapter<T> implements UOWAction, SmartTransactionObject {
312314

313315
private final TransactionDefinition definition;
314316

@@ -373,6 +375,16 @@ public T getResult() {
373375
}
374376
return this.result;
375377
}
378+
379+
@Override
380+
public boolean isRollbackOnly() {
381+
return uowManager.getRollbackOnly();
382+
}
383+
384+
@Override
385+
public void flush() {
386+
TransactionSynchronizationUtils.triggerFlush();
387+
}
376388
}
377389

378390
}

0 commit comments

Comments
 (0)