geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From genspr...@apache.org
Subject svn commit: r1166178 - /geronimo/server/trunk/plugins/corba/geronimo-corba/src/main/java/org/apache/geronimo/corba/transaction/nodistributedtransactions/NoDTxClientTransactionPolicyConfig.java
Date Wed, 07 Sep 2011 13:44:57 GMT
Author: genspring
Date: Wed Sep  7 13:44:57 2011
New Revision: 1166178

URL: http://svn.apache.org/viewvc?rev=1166178&view=rev
Log:
org.apache.openejb.util.TransactionUtils was removed from openejb 4.0.

Modified:
    geronimo/server/trunk/plugins/corba/geronimo-corba/src/main/java/org/apache/geronimo/corba/transaction/nodistributedtransactions/NoDTxClientTransactionPolicyConfig.java

Modified: geronimo/server/trunk/plugins/corba/geronimo-corba/src/main/java/org/apache/geronimo/corba/transaction/nodistributedtransactions/NoDTxClientTransactionPolicyConfig.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/corba/geronimo-corba/src/main/java/org/apache/geronimo/corba/transaction/nodistributedtransactions/NoDTxClientTransactionPolicyConfig.java?rev=1166178&r1=1166177&r2=1166178&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/corba/geronimo-corba/src/main/java/org/apache/geronimo/corba/transaction/nodistributedtransactions/NoDTxClientTransactionPolicyConfig.java
(original)
+++ geronimo/server/trunk/plugins/corba/geronimo-corba/src/main/java/org/apache/geronimo/corba/transaction/nodistributedtransactions/NoDTxClientTransactionPolicyConfig.java
Wed Sep  7 13:44:57 2011
@@ -16,6 +16,8 @@
  */
 package org.apache.geronimo.corba.transaction.nodistributedtransactions;
 
+import javax.transaction.Status;
+import javax.transaction.SystemException;
 import javax.transaction.TransactionManager;
 
 import org.omg.CORBA.Any;
@@ -31,18 +33,28 @@ import org.omg.IOP.TransactionService;
 import org.omg.PortableInterceptor.ClientRequestInfo;
 import org.apache.geronimo.corba.transaction.ClientTransactionPolicyConfig;
 import org.apache.geronimo.corba.util.Util;
-import org.apache.openejb.util.TransactionUtils;
 
 /**
  * @version $Rev: 451417 $ $Date: 2006-09-29 13:13:22 -0700 (Fri, 29 Sep 2006) $
  */
 public class NoDTxClientTransactionPolicyConfig implements ClientTransactionPolicyConfig
{
 
+    private static final long serialVersionUID = 3330069139634001416L;
     private static final TransIdentity[] NO_PARENTS = new TransIdentity[0];
     private static final otid_t NULL_XID = new otid_t(0, 0, new byte[0]);
 
     private final TransactionManager transactionManager;
 
+    
+    public static boolean isTransactionActive(TransactionManager transactionManager) {
+        try {
+            int status = transactionManager.getStatus();
+            return status == Status.STATUS_ACTIVE || status == Status.STATUS_MARKED_ROLLBACK;
+        } catch (SystemException ignored) {
+            return false;
+        }
+    }
+
     public NoDTxClientTransactionPolicyConfig(TransactionManager transactionManager) {
         if (transactionManager == null) {
             throw new IllegalArgumentException("transactionManager must not be null");
@@ -51,7 +63,7 @@ public class NoDTxClientTransactionPolic
     }
 
     public void exportTransaction(ClientRequestInfo ri) {
-        if (TransactionUtils.isTransactionActive(transactionManager)) {
+        if (isTransactionActive(transactionManager)) {
             //19.6.2.1 (1) propagate an "empty" transaction context.
             //but, it needs an xid!
             TransIdentity transIdentity = new TransIdentity(null, null, NULL_XID);



Mime
View raw message