From 03f3412434b769d6545fa3c3aa3e83ae21f06705 Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Thu, 19 Jun 2014 22:30:10 +0200 Subject: [PATCH] WebSphereUowTransactionManager exposes SmartTransactionObject Issue: SPR-11876 --- .../jta/WebSphereUowTransactionManager.java | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 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 77a82cd1fe8..f5324ee1853 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-2013 the original author or authors. + * Copyright 2002-2014 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. @@ -35,9 +35,11 @@ import org.springframework.transaction.TransactionSystemException; import org.springframework.transaction.support.CallbackPreferringPlatformTransactionManager; import org.springframework.transaction.support.DefaultTransactionDefinition; import org.springframework.transaction.support.DefaultTransactionStatus; +import org.springframework.transaction.support.SmartTransactionObject; import org.springframework.transaction.support.TransactionCallback; import org.springframework.transaction.support.TransactionSynchronization; import org.springframework.transaction.support.TransactionSynchronizationManager; +import org.springframework.transaction.support.TransactionSynchronizationUtils; import org.springframework.util.ReflectionUtils; /** @@ -308,7 +310,7 @@ public class WebSphereUowTransactionManager extends JtaTransactionManager /** * Adapter that executes the given Spring transaction within the WebSphere UOWAction shape. */ - private class UOWActionAdapter implements UOWAction { + private class UOWActionAdapter implements UOWAction, SmartTransactionObject { private final TransactionDefinition definition; @@ -373,6 +375,16 @@ public class WebSphereUowTransactionManager extends JtaTransactionManager } return this.result; } + + @Override + public boolean isRollbackOnly() { + return uowManager.getRollbackOnly(); + } + + @Override + public void flush() { + TransactionSynchronizationUtils.triggerFlush(); + } } }