You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@aries.apache.org by ti...@apache.org on 2018/01/23 16:40:54 UTC

[aries-tx-control] 02/02: Ensure that a RollbackException is generated for unexpected failures

This is an automated email from the ASF dual-hosted git repository.

timothyjward pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/aries-tx-control.git

commit 9d241cd324299a255441672c077402c3b0dd1907
Author: Tim Ward <ti...@apache.org>
AuthorDate: Tue Jan 23 11:35:48 2018 -0500

    Ensure that a RollbackException is generated for unexpected failures
---
 .../aries/tx/control/service/xa/impl/TransactionContextImpl.java      | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tx-control-services/tx-control-service-xa/src/main/java/org/apache/aries/tx/control/service/xa/impl/TransactionContextImpl.java b/tx-control-services/tx-control-service-xa/src/main/java/org/apache/aries/tx/control/service/xa/impl/TransactionContextImpl.java
index fe58f84..678f416 100644
--- a/tx-control-services/tx-control-service-xa/src/main/java/org/apache/aries/tx/control/service/xa/impl/TransactionContextImpl.java
+++ b/tx-control-services/tx-control-service-xa/src/main/java/org/apache/aries/tx/control/service/xa/impl/TransactionContextImpl.java
@@ -53,6 +53,7 @@ import org.apache.geronimo.transaction.manager.SetRollbackOnlyException;
 import org.osgi.service.transaction.control.LocalResource;
 import org.osgi.service.transaction.control.TransactionContext;
 import org.osgi.service.transaction.control.TransactionException;
+import org.osgi.service.transaction.control.TransactionRolledBackException;
 import org.osgi.service.transaction.control.TransactionStatus;
 
 public class TransactionContextImpl extends AbstractTransactionContextImpl implements TransactionContext {
@@ -315,6 +316,9 @@ public class TransactionContextImpl extends AbstractTransactionContextImpl imple
 							// This means that a pre-completion callback called setRollbackOnly
 							// which can be safely ignored (i.e. it's not really an exception)
 						}
+						TransactionRolledBackException tre = 
+								new TransactionRolledBackException(re.getMessage(), re);
+						throw tre;
 					}
 				}
 			} catch (Exception e) {

-- 
To stop receiving notification emails like this one, please contact
timothyjward@apache.org.