diff --git a/ArjunaJTA/jta/classes/com/arjuna/ats/internal/jta/recovery/arjunacore/CommitMarkableResourceRecordRecoveryModule.java b/ArjunaJTA/jta/classes/com/arjuna/ats/internal/jta/recovery/arjunacore/CommitMarkableResourceRecordRecoveryModule.java
index 1373a7282..21f59db05 100644
--- a/ArjunaJTA/jta/classes/com/arjuna/ats/internal/jta/recovery/arjunacore/CommitMarkableResourceRecordRecoveryModule.java
+++ b/ArjunaJTA/jta/classes/com/arjuna/ats/internal/jta/recovery/arjunacore/CommitMarkableResourceRecordRecoveryModule.java
@@ -30,26 +30,28 @@ import java.sql.ResultSet;
 import java.sql.SQLException;
 import java.sql.Statement;
 import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Enumeration;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
+import java.util.Vector;
 
 import javax.naming.InitialContext;
 import javax.naming.NamingException;
 import javax.sql.DataSource;
 import javax.transaction.xa.Xid;
 
-import com.arjuna.ats.arjuna.AtomicAction;
 import com.arjuna.ats.arjuna.common.Uid;
 import com.arjuna.ats.arjuna.coordinator.ActionStatus;
 import com.arjuna.ats.arjuna.exceptions.ObjectStoreException;
 import com.arjuna.ats.arjuna.logging.tsLogger;
-import com.arjuna.ats.arjuna.objectstore.ObjectStoreIterator;
 import com.arjuna.ats.arjuna.objectstore.RecoveryStore;
 import com.arjuna.ats.arjuna.objectstore.StoreManager;
+import com.arjuna.ats.arjuna.recovery.RecoveryManager;
 import com.arjuna.ats.arjuna.recovery.RecoveryModule;
 import com.arjuna.ats.arjuna.recovery.TransactionStatusConnectionManager;
 import com.arjuna.ats.arjuna.state.InputObjectState;
@@ -80,6 +82,8 @@ public class CommitMarkableResourceRecordRecoveryModule implements
 	private static final String CONNECTABLE_ATOMIC_ACTION_TYPE =
 	    RecoverConnectableAtomicAction.CONNECTABLE_ATOMIC_ACTION_TYPE;
 
+	private static CommitMarkableResourceRecordRecoveryModule registeredCMRRecoveryModule;
+
 	private InitialContext context;
 
 	private List<String> jndiNamesToContact = new ArrayList<String>();
@@ -114,6 +118,30 @@ public class CommitMarkableResourceRecordRecoveryModule implements
     private boolean inFirstPass;
 	private static String defaultTableName = jtaEnvironmentBean
 			.getDefaultCommitMarkableTableName();
+	private Set<Xid> xidsMovedToAtomicAction = new HashSet<>();
+
+	/**
+	 * Looking through registered recovery modules and trying to find the CMR one.
+	 *
+	 * @return CMRRecoveryModule when it was registered, otherwise null
+	 */
+	public static CommitMarkableResourceRecordRecoveryModule getRegisteredCMRRecoveryModule () {
+		if (registeredCMRRecoveryModule == null) {
+			RecoveryManager recMan = RecoveryManager.manager();
+			Vector recoveryModules = recMan.getModules();
+			if (recoveryModules != null) {
+				Enumeration modules = recoveryModules.elements();
+				while (modules.hasMoreElements()) {
+					RecoveryModule m = (RecoveryModule) modules.nextElement();
+					if (m instanceof CommitMarkableResourceRecordRecoveryModule) {
+						registeredCMRRecoveryModule = (CommitMarkableResourceRecordRecoveryModule) m;
+						break;
+					}
+				}
+			}
+		}
+		return registeredCMRRecoveryModule;
+	}
 
 	public CommitMarkableResourceRecordRecoveryModule() throws NamingException,
 			ObjectStoreException {
@@ -198,6 +226,7 @@ public class CommitMarkableResourceRecordRecoveryModule implements
 		this.committedXidsToJndiNames.clear();
 		this.queriedResourceManagers.clear();
 		this.jndiNamesToPossibleXidsForGC.clear();
+		this.xidsMovedToAtomicAction.clear();
 
 		// The algorithm occurs in three stages:
 		// 1. We query the database to find all the branches that were committed
@@ -349,7 +378,10 @@ public class CommitMarkableResourceRecordRecoveryModule implements
     							// Check if the resource manager is online yet
     							if (queriedResourceManagers
     									.contains(commitMarkableResourceJndiName)) {
-    
+	
+									if (tsLogger.logger.isTraceEnabled()) {
+										tsLogger.logger.trace("Moving " + currentUid + " back to being an AA");
+									}
     								// If it is remove the CRR and move it back and
     								// let
     								// the
@@ -367,6 +399,8 @@ public class CommitMarkableResourceRecordRecoveryModule implements
                                         CONNECTABLE_ATOMIC_ACTION_TYPE,
                                         ATOMIC_ACTION_TYPE);    						    
     						}
+    						// marking the xid as maintained by the CMR recovery module as possible for commit
+    						xidsMovedToAtomicAction.add(rcaa.getXid());
                         }
 					}
 					
@@ -446,6 +480,10 @@ public class CommitMarkableResourceRecordRecoveryModule implements
 
 	@Override
 	public synchronized void periodicWorkSecondPass() {
+		if (tsLogger.logger.isTraceEnabled()) {
+			tsLogger.logger.trace("CommitMarkableResourceRecordRecoveryModule second pass");
+		}
+
 		/**
 		 * This is the list of AtomicActions that were prepared but not
 		 * completed.
@@ -522,6 +560,15 @@ public class CommitMarkableResourceRecordRecoveryModule implements
 		return committed != null;
 	}
 
+	public synchronized boolean doesBelongsToCMRMovedToAtomicAction(Xid xid) {
+	    if(xid == null) return false;
+	    for(Xid proposedXid: this.xidsMovedToAtomicAction) {
+	        if(proposedXid.getFormatId() == xid.getFormatId() && Arrays.equals(proposedXid.getGlobalTransactionId(), xid.getGlobalTransactionId()))
+	            return true;
+	    }
+	    return false;
+	}
+
 	private List<Uid> convertToList(InputObjectState aa_uids) {
 		List<Uid> uids = new ArrayList<Uid>();
 
@@ -550,6 +597,8 @@ public class CommitMarkableResourceRecordRecoveryModule implements
 		return uids;
 	}
 
+
+
 	private boolean isTransactionInMidFlight(int status) {
 		boolean inFlight = false;
 
diff --git a/ArjunaJTA/jta/classes/com/arjuna/ats/internal/jta/recovery/arjunacore/XARecoveryModule.java b/ArjunaJTA/jta/classes/com/arjuna/ats/internal/jta/recovery/arjunacore/XARecoveryModule.java
index 482f69b7a..d15d59130 100644
--- a/ArjunaJTA/jta/classes/com/arjuna/ats/internal/jta/recovery/arjunacore/XARecoveryModule.java
+++ b/ArjunaJTA/jta/classes/com/arjuna/ats/internal/jta/recovery/arjunacore/XARecoveryModule.java
@@ -321,6 +321,14 @@ public class XARecoveryModule implements ExtendedRecoveryModule
 
 				// JBTM-1255 moved stale check back to bottomUpRecovery
 				if (xids.contains(xid)) {
+					// verification if the XA resource was not handled as part of the transaction where participated a CMR resource
+					// if the XAResource was part of such transaction we do want to remove it from _xidScans
+					// for not being handled twice by top-down and bottom-up recovery which brings commit and rollback being called both
+					CommitMarkableResourceRecordRecoveryModule cmrRecoveryModule  = CommitMarkableResourceRecordRecoveryModule.getRegisteredCMRRecoveryModule();
+					if(cmrRecoveryModule != null && cmrRecoveryModule.doesBelongsToCMRMovedToAtomicAction(xid)) {
+						xids.remove(xid);
+					}
+
 					// This Xid will hopefully be recovered by the AtomicAction
 					// We do not remove it from the map as there is garbage collection in RecoveryXids already
 					// and it is possible that the Xid is recovered by both txbridge and XATerminator - the second
diff --git a/ArjunaJTA/jta/classes/com/arjuna/ats/internal/jta/resources/arjunacore/CommitMarkableResourceRecord.java b/ArjunaJTA/jta/classes/com/arjuna/ats/internal/jta/resources/arjunacore/CommitMarkableResourceRecord.java
index 6edd0cdd9..f1a1a26d5 100644
--- a/ArjunaJTA/jta/classes/com/arjuna/ats/internal/jta/resources/arjunacore/CommitMarkableResourceRecord.java
+++ b/ArjunaJTA/jta/classes/com/arjuna/ats/internal/jta/resources/arjunacore/CommitMarkableResourceRecord.java
@@ -109,7 +109,6 @@ public class CommitMarkableResourceRecord extends AbstractRecord {
 	private String productName;
 	private String productVersion;
 	private boolean hasCompleted;
-	private static CommitMarkableResourceRecordRecoveryModule commitMarkableResourceRecoveryModule;
 	private static final JTAEnvironmentBean jtaEnvironmentBean = BeanPopulator
 			.getDefaultInstance(JTAEnvironmentBean.class);
 	private static final Map<String, String> commitMarkableResourceTableNameMap = jtaEnvironmentBean
@@ -124,24 +123,6 @@ public class CommitMarkableResourceRecord extends AbstractRecord {
 	private static final Map<String, Boolean> isPerformImmediateCleanupOfCommitMarkableResourceBranchesMap = jtaEnvironmentBean
 			.getPerformImmediateCleanupOfCommitMarkableResourceBranchesMap();
 
-	static {
-		commitMarkableResourceRecoveryModule = null;
-		RecoveryManager recMan = RecoveryManager.manager();
-		Vector recoveryModules = recMan.getModules();
-		if (recoveryModules != null) {
-			Enumeration modules = recoveryModules.elements();
-
-			while (modules.hasMoreElements()) {
-				RecoveryModule m = (RecoveryModule) modules.nextElement();
-
-				if (m instanceof CommitMarkableResourceRecordRecoveryModule) {
-					commitMarkableResourceRecoveryModule = (CommitMarkableResourceRecordRecoveryModule) m;
-					break;
-				}
-			}
-		}
-	}
-
 	/**
 	 * For recovery
 	 */
@@ -278,9 +259,8 @@ public class CommitMarkableResourceRecord extends AbstractRecord {
 				@Override
 				public void afterCompletion(int status) {
 					if (!onePhase && status == Status.STATUS_COMMITTED) {
-						commitMarkableResourceRecoveryModule
-								.notifyOfCompletedBranch(
-										commitMarkableJndiName, xid);
+					    CommitMarkableResourceRecordRecoveryModule.getRegisteredCMRRecoveryModule()
+							.notifyOfCompletedBranch(commitMarkableJndiName, xid);
 					}
 				}
 			});
@@ -365,7 +345,8 @@ public class CommitMarkableResourceRecord extends AbstractRecord {
 				// CommitMarkableRecoveryModule is
 				// between phases and the XID
 				// has not been GC'd
-                committed = commitMarkableResourceRecoveryModule.wasCommitted(commitMarkableJndiName, xid);
+                committed = CommitMarkableResourceRecordRecoveryModule.getRegisteredCMRRecoveryModule()
+                        .wasCommitted(commitMarkableJndiName, xid);
             }
 			productName = os.unpackString();
 			productVersion = os.unpackString();
diff --git a/ArjunaJTA/jta/classes/com/arjuna/ats/internal/jta/resources/arjunacore/XAResourceRecord.java b/ArjunaJTA/jta/classes/com/arjuna/ats/internal/jta/resources/arjunacore/XAResourceRecord.java
index 0f55e983a..56051595c 100644
--- a/ArjunaJTA/jta/classes/com/arjuna/ats/internal/jta/resources/arjunacore/XAResourceRecord.java
+++ b/ArjunaJTA/jta/classes/com/arjuna/ats/internal/jta/resources/arjunacore/XAResourceRecord.java
@@ -1234,29 +1234,16 @@ public class XAResourceRecord extends AbstractRecord implements ExceptionDeferre
 
 	private final XAResource getNewXAResource()
 	{
-		RecoveryManager recMan = RecoveryManager.manager();
-		Vector recoveryModules = recMan.getModules();
-
-		if (recoveryModules != null)
-		{
-			Enumeration modules = recoveryModules.elements();
-
-			while (modules.hasMoreElements())
-			{
-				RecoveryModule m = (RecoveryModule) modules.nextElement();
-
-				if (m instanceof XARecoveryModule)
-				{
-				    /*
-				     * Blaargh! There are better ways to do this!
-				     */
-
-					return ((XARecoveryModule) m).getNewXAResource(this);
-				}
-			}
-		}
+	    XARecoveryModule xaRecoveryModule = XARecoveryModule.getRegisteredXARecoveryModule();
+	    if(xaRecoveryModule != null) {
+	        /*
+	         * Blaargh! There are better ways to do this!
+	         */
 
-		return null;
+	        return xaRecoveryModule.getNewXAResource(this);
+	    } else {
+	        return null;
+	    }
 	}
 
 	private final void removeConnection()
