geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nre...@apache.org
Subject [geode] branch develop updated: Feature/geode 3583 storage (#1285)
Date Tue, 16 Jan 2018 21:20:35 GMT
This is an automated email from the ASF dual-hosted git repository.

nreich pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode.git


The following commit(s) were added to refs/heads/develop by this push:
     new 7339fbc  Feature/geode 3583 storage (#1285)
7339fbc is described below

commit 7339fbcd7207fc894a6116ce644399473aa7a239
Author: agingade <agingade@pivotal.io>
AuthorDate: Tue Jan 16 13:20:31 2018 -0800

    Feature/geode 3583 storage (#1285)
    
    * This resolves the following tickets: GEODE-4196, GEODE-4197, GEODE-4198, GEODE-4199
       GEODE-4200, GEODE-4201, GEODE-4203, GEODE-4204, GEODE-4205, GEODE-4206
       GEODE-4208, GEODE-4209, GEODE-4210, GEODE-4212, and GEODE-4213
---
 .../gatewaydelta/GatewayDeltaCreateEvent.java      |   4 +-
 .../apache/geode/cache/CacheClosedException.java   |   5 -
 .../java/org/apache/geode/cache/CacheFactory.java  |   2 +-
 .../geode/cache/client/internal/ProxyCache.java    |   9 +-
 .../geode/cache/client/internal/ProxyRegion.java   |   2 +-
 .../geode/cache/query/internal/DefaultQuery.java   |   2 +-
 .../cache/query/internal/ProxyQueryService.java    |   2 +-
 .../cache/query/internal/index/AbstractIndex.java  |   5 +-
 .../geode/cache/snapshot/SnapshotReader.java       |  16 ++-
 .../internal/InternalDistributedSystem.java        |  13 ++-
 .../geode/internal/cache/AbstractDiskRegion.java   |   5 +
 .../apache/geode/internal/cache/BucketAdvisor.java |   2 +-
 .../internal/cache/BucketPersistenceAdvisor.java   |   2 +-
 .../apache/geode/internal/cache/BucketRegion.java  |   4 +-
 .../internal/cache/CacheDistributionAdvisor.java   |   3 +-
 .../geode/internal/cache/CacheServerAdvisor.java   |   2 +-
 .../cache/CachedDeserializableFactory.java         |  13 ++-
 .../geode/internal/cache/CloseCacheMessage.java    |   2 +-
 .../geode/internal/cache/ControllerAdvisor.java    |   2 +-
 .../apache/geode/internal/cache/DiskStoreImpl.java |  14 +--
 .../geode/internal/cache/DiskStoreMonitor.java     |  45 ++++----
 .../apache/geode/internal/cache/DistTXState.java   |  10 ++
 .../geode/internal/cache/DistTXStateProxyImpl.java |  15 +--
 .../cache/DistTXStateProxyImplOnCoordinator.java   |  35 +++---
 .../cache/DistTXStateProxyImplOnDatanode.java      |   9 +-
 .../internal/cache/DistributedPutAllOperation.java |   2 +-
 .../DistributedRegionFunctionStreamingMessage.java |  11 +-
 .../geode/internal/cache/EntryEventImpl.java       |  36 +++---
 .../geode/internal/cache/GemFireCacheImpl.java     |  10 +-
 .../apache/geode/internal/cache/GridAdvisor.java   |  11 +-
 .../internal/cache/InitialImageOperation.java      |  69 +++++++++---
 .../apache/geode/internal/cache/InternalCache.java |   2 +
 .../apache/geode/internal/cache/LocalRegion.java   |  20 +---
 .../cache/MemberFunctionStreamingMessage.java      |  12 +-
 .../org/apache/geode/internal/cache/Oplog.java     |  18 ++-
 .../internal/cache/PRHARedundancyProvider.java     |   4 +-
 .../internal/cache/PartitionAttributesImpl.java    |   3 +-
 .../cache/PartitionRegionConfigValidator.java      |   2 +-
 .../geode/internal/cache/PartitionedRegion.java    |  14 +--
 .../internal/cache/PartitionedRegionHelper.java    |  16 ++-
 .../internal/cache/PausedTXStateProxyImpl.java     |   3 +-
 .../geode/internal/cache/RegionEntryContext.java   |   2 +
 .../geode/internal/cache/RemoteGetMessage.java     |   3 +-
 .../internal/cache/RemoteOperationMessage.java     |  12 +-
 .../geode/internal/cache/TXCommitMessage.java      |  14 ++-
 .../apache/geode/internal/cache/TXManagerImpl.java |  16 +--
 .../org/apache/geode/internal/cache/TXMessage.java |  10 +-
 .../internal/cache/TXRegionLockRequestImpl.java    |  33 +++---
 .../apache/geode/internal/cache/TXRegionState.java |   4 +-
 .../org/apache/geode/internal/cache/TXState.java   |   4 +-
 .../geode/internal/cache/TXStateInterface.java     |   4 +-
 .../geode/internal/cache/TXStateProxyImpl.java     | 122 +++++++++++++++++----
 .../apache/geode/internal/cache/TXStateStub.java   |  56 +++++++++-
 .../internal/cache/TXSynchronizationRunnable.java  |  36 ++----
 .../cache/entries/AbstractRegionEntry.java         |  14 +--
 .../geode/internal/cache/entries/DiskEntry.java    |  20 ++--
 .../cache/execute/ServerFunctionExecutor.java      |   4 +-
 .../execute/ServerRegionFunctionExecutor.java      |   4 +-
 .../internal/cache/partitioned/GetMessage.java     |   3 +-
 .../cache/partitioned/PartitionMessage.java        |  12 +-
 .../cache/snapshot/CacheSnapshotServiceImpl.java   |   2 +-
 .../internal/cache/snapshot/ClientExporter.java    |   7 +-
 .../geode/internal/cache/snapshot/GFSnapshot.java  |  27 ++---
 .../cache/snapshot/RegionSnapshotServiceImpl.java  |   9 +-
 .../sockets/command/GatewayReceiverCommand.java    |   2 +-
 .../cache/tier/sockets/command/PutAll.java         |   3 +-
 .../cache/tier/sockets/command/PutAll70.java       |   3 +-
 .../cache/tier/sockets/command/PutAll80.java       |   3 +-
 .../tier/sockets/command/TXFailoverCommand.java    |  13 ++-
 .../sockets/command/TXSynchronizationCommand.java  |   3 +-
 .../geode/internal/cache/tx/ClientTXStateStub.java |  61 +++++++----
 .../internal/cache/tx/DistClientTXStateStub.java   |  16 +--
 .../geode/internal/cache/tx/DistTxEntryEvent.java  |  27 +++--
 .../internal/cache/tx/PartitionedTXRegionStub.java |   4 +-
 .../internal/cache/wan/GatewaySenderEventImpl.java |  33 ------
 .../internal/cache/xmlcache/CacheCreation.java     |   5 +
 .../internal/offheap/MemoryAllocatorImpl.java      |  16 +--
 .../geode/internal/offheap/OffHeapHelper.java      |   9 +-
 .../internal/offheap/OffHeapRegionEntryHelper.java |   4 +-
 .../geode/management/cli/CommandService.java       |   8 +-
 .../geode/pdx/internal/ClientTypeRegistration.java |   4 +-
 ...ibutedAckOverflowRegionCCEOffHeapDUnitTest.java |   2 +-
 ...utedAckPersistentRegionCCEOffHeapDUnitTest.java |   2 +-
 .../DistributedAckRegionCCEOffHeapDUnitTest.java   |   2 +-
 .../DistributedAckRegionOffHeapDUnitTest.java      |   2 +-
 .../DistributedNoAckRegionCCEOffHeapDUnitTest.java |   2 +-
 .../DistributedNoAckRegionOffHeapDUnitTest.java    |   2 +-
 .../cache30/GlobalRegionCCEOffHeapDUnitTest.java   |   2 +-
 .../cache30/GlobalRegionOffHeapDUnitTest.java      |   2 +-
 .../OffHeapLRUEvictionControllerDUnitTest.java     |   2 +-
 .../cache30/PartitionedRegionOffHeapDUnitTest.java |   2 +-
 .../internal/PutAllOperationContextJUnitTest.java  |   2 +-
 ...rInfoMessageTest.java => CacheProfileTest.java} |  35 ++++--
 .../cache/ClientServerGetAllDUnitTest.java         |   2 +-
 ...oMessageTest.java => DiskStoreMonitorTest.java} |  37 +++++--
 .../DistrbutedRegionProfileOffHeapDUnitTest.java   |   2 +-
 .../geode/internal/cache/GemFireCacheImplTest.java |  91 +++++++++++++++
 .../geode/internal/cache/GridProfileTest.java      |   6 +-
 ...ageTest.java => InitialImageOperationTest.java} |  32 +++++-
 .../cache/NetSearchMessagingDUnitTest.java         |   4 +-
 .../geode/internal/cache/OffHeapTestUtil.java      |   6 +-
 .../geode/internal/cache/OplogJUnitTest.java       |   2 +-
 .../cache/PartitionAttributesImplJUnitTest.java    |  47 ++++++++
 ...tionedRegionLocalMaxMemoryOffHeapDUnitTest.java |   2 +-
 .../PartitionedRegionOffHeapEvictionDUnitTest.java |   2 +-
 ...rInfoMessageTest.java => RegionCommitTest.java} |  34 +++++-
 .../cache/RequestFilterInfoMessageTest.java        |  30 +++++
 ...eTest.java => TXRegionLockRequestImplTest.java} |  33 ++++--
 .../internal/cache/TXReservationMgrJUnitTest.java  |   2 +-
 ...mplJUnitTest.java => TXStateProxyImplTest.java} |  57 +++++++---
 .../cache/TXSynchronizationRunnableTest.java       |  64 +++++++++++
 .../cache/eviction/OffHeapEvictionDUnitTest.java   |   2 +-
 .../eviction/OffHeapEvictionStatsDUnitTest.java    |   2 +-
 .../cache/partitioned/PartitionMessageTest.java    |   1 +
 .../cache/snapshot/ClientExporterTest.java         |  52 +++++++++
 .../snapshot/GFSnapshotJUnitPerformanceTest.java   |   4 +-
 .../ForceInvalidateOffHeapEvictionDUnitTest.java   |   2 +-
 .../sockets/command/TXFailoverCommandTest.java     |  72 ++++++------
 .../internal/cache/tx/ClientTXStateStubTest.java   |  82 ++++++++++++++
 .../CompressionCacheListenerOffHeapDUnitTest.java  |   2 +-
 .../CompressionRegionOperationsDUnitTest.java      |  15 ++-
 ...ompressionRegionOperationsOffHeapDUnitTest.java |   2 +-
 .../geode/internal/lang/StringUtilsJUnitTest.java  |   2 +-
 .../internal/offheap/MemoryAllocatorJUnitTest.java |   2 +-
 .../internal/offheap/OffHeapHelperJUnitTest.java   |  26 ++---
 .../geode/internal/offheap/OffHeapRegionBase.java  |   2 +-
 .../offheap/OutOfOffHeapMemoryDUnitTest.java       |   2 +-
 .../codeAnalysis/sanctionedDataSerializables.txt   |  87 +++++++--------
 .../cache/query/internal/cq/ClientCQImpl.java      |   6 +-
 129 files changed, 1328 insertions(+), 633 deletions(-)

diff --git a/extensions/geode-modules/src/main/java/org/apache/geode/modules/gatewaydelta/GatewayDeltaCreateEvent.java b/extensions/geode-modules/src/main/java/org/apache/geode/modules/gatewaydelta/GatewayDeltaCreateEvent.java
index 801b3c4..1f2adda 100644
--- a/extensions/geode-modules/src/main/java/org/apache/geode/modules/gatewaydelta/GatewayDeltaCreateEvent.java
+++ b/extensions/geode-modules/src/main/java/org/apache/geode/modules/gatewaydelta/GatewayDeltaCreateEvent.java
@@ -25,6 +25,7 @@ import org.apache.geode.cache.Cache;
 import org.apache.geode.cache.Region;
 import org.apache.geode.internal.cache.CachedDeserializable;
 import org.apache.geode.internal.cache.CachedDeserializableFactory;
+import org.apache.geode.internal.cache.InternalCache;
 
 @SuppressWarnings("serial")
 public class GatewayDeltaCreateEvent extends AbstractGatewayDeltaEvent {
@@ -44,7 +45,8 @@ public class GatewayDeltaCreateEvent extends AbstractGatewayDeltaEvent {
 
   public void apply(Cache cache) {
     Region<String, CachedDeserializable> region = getRegion(cache);
-    region.put(this.key, CachedDeserializableFactory.create(this.gatewayDelta), true);
+    region.put(this.key,
+        CachedDeserializableFactory.create(this.gatewayDelta, (InternalCache) cache), true);
     if (cache.getLogger().fineEnabled()) {
       StringBuilder builder = new StringBuilder();
       builder.append("Applied ").append(this);
diff --git a/geode-core/src/main/java/org/apache/geode/cache/CacheClosedException.java b/geode-core/src/main/java/org/apache/geode/cache/CacheClosedException.java
index d149462..199e5b8 100644
--- a/geode-core/src/main/java/org/apache/geode/cache/CacheClosedException.java
+++ b/geode-core/src/main/java/org/apache/geode/cache/CacheClosedException.java
@@ -42,11 +42,6 @@ public class CacheClosedException extends CancelException {
    */
   public CacheClosedException(String msg) {
     super(msg);
-    // bug #43108 - CacheClosedException should include cause of closure TODO: but not this way!
-    InternalCache cache = GemFireCacheImpl.getInstance();
-    if (cache != null) {
-      initCause(cache.getDisconnectCause());
-    }
   }
 
   /**
diff --git a/geode-core/src/main/java/org/apache/geode/cache/CacheFactory.java b/geode-core/src/main/java/org/apache/geode/cache/CacheFactory.java
index 1eb649a..5857927 100644
--- a/geode-core/src/main/java/org/apache/geode/cache/CacheFactory.java
+++ b/geode-core/src/main/java/org/apache/geode/cache/CacheFactory.java
@@ -295,7 +295,7 @@ public class CacheFactory {
             LocalizedStrings.CacheFactory_THE_CACHE_HAS_BEEN_CLOSED.toLocalizedString(), null);
       }
       if (!instance.getDistributedSystem().equals(system)) {
-        throw new CacheClosedException(
+        throw instance.getCacheClosedException(
             LocalizedStrings.CacheFactory_A_CACHE_HAS_NOT_YET_BEEN_CREATED_FOR_THE_GIVEN_DISTRIBUTED_SYSTEM
                 .toLocalizedString());
       }
diff --git a/geode-core/src/main/java/org/apache/geode/cache/client/internal/ProxyCache.java b/geode-core/src/main/java/org/apache/geode/cache/client/internal/ProxyCache.java
index bb56597..711e8cb 100755
--- a/geode-core/src/main/java/org/apache/geode/cache/client/internal/ProxyCache.java
+++ b/geode-core/src/main/java/org/apache/geode/cache/client/internal/ProxyCache.java
@@ -190,11 +190,11 @@ public class ProxyCache implements RegionService {
       }
       if (e == null) {
         // Caller did not specify any root cause, so just use our own.
-        return new CacheClosedException(reason);
+        return cache.getCacheClosedException(reason);
       }
 
       try {
-        return new CacheClosedException(reason, e);
+        return cache.getCacheClosedException(reason, e);
       } catch (IllegalStateException ignore) {
         // Bug 39496 (Jrockit related) Give up. The following
         // error is not entirely sane but gives the correct general picture.
@@ -233,4 +233,9 @@ public class ProxyCache implements RegionService {
   public PdxInstance createPdxEnum(String className, String enumName, int enumOrdinal) {
     return PdxInstanceFactoryImpl.createPdxEnum(className, enumName, enumOrdinal, this.cache);
   }
+
+  /** return a CacheClosedException with the given reason */
+  public CacheClosedException getCacheClosedException(String reason) {
+    return cache.getCacheClosedException(reason);
+  }
 }
diff --git a/geode-core/src/main/java/org/apache/geode/cache/client/internal/ProxyRegion.java b/geode-core/src/main/java/org/apache/geode/cache/client/internal/ProxyRegion.java
index 2ab578e..5efac16 100755
--- a/geode-core/src/main/java/org/apache/geode/cache/client/internal/ProxyRegion.java
+++ b/geode-core/src/main/java/org/apache/geode/cache/client/internal/ProxyRegion.java
@@ -607,7 +607,7 @@ public class ProxyRegion implements Region {
 
   private void preOp() {
     if (this.proxyCache.isClosed()) {
-      throw new CacheClosedException("Cache is closed for this user.");
+      throw proxyCache.getCacheClosedException("Cache is closed for this user.");
     }
     UserAttributes.userAttributes.set(this.proxyCache.getUserAttributes());
   }
diff --git a/geode-core/src/main/java/org/apache/geode/cache/query/internal/DefaultQuery.java b/geode-core/src/main/java/org/apache/geode/cache/query/internal/DefaultQuery.java
index d6e1163..4df0bbf 100644
--- a/geode-core/src/main/java/org/apache/geode/cache/query/internal/DefaultQuery.java
+++ b/geode-core/src/main/java/org/apache/geode/cache/query/internal/DefaultQuery.java
@@ -448,7 +448,7 @@ public class DefaultQuery implements Query {
     try {
       if (this.proxyCache != null) {
         if (this.proxyCache.isClosed()) {
-          throw new CacheClosedException("Cache is closed for this user.");
+          throw proxyCache.getCacheClosedException("Cache is closed for this user.");
         }
         UserAttributes.userAttributes.set(this.proxyCache.getUserAttributes());
       }
diff --git a/geode-core/src/main/java/org/apache/geode/cache/query/internal/ProxyQueryService.java b/geode-core/src/main/java/org/apache/geode/cache/query/internal/ProxyQueryService.java
index cec4ed8..51f9823 100755
--- a/geode-core/src/main/java/org/apache/geode/cache/query/internal/ProxyQueryService.java
+++ b/geode-core/src/main/java/org/apache/geode/cache/query/internal/ProxyQueryService.java
@@ -416,7 +416,7 @@ public class ProxyQueryService implements QueryService {
 
   private void preOp(boolean setTL) {
     if (this.proxyCache.isClosed()) {
-      throw new CacheClosedException("Cache is closed for this user.");
+      throw proxyCache.getCacheClosedException("Cache is closed for this user.");
     }
     if (setTL) {
       UserAttributes.userAttributes.set(this.proxyCache.getUserAttributes());
diff --git a/geode-core/src/main/java/org/apache/geode/cache/query/internal/index/AbstractIndex.java b/geode-core/src/main/java/org/apache/geode/cache/query/internal/index/AbstractIndex.java
index 4c5183d..a025364 100644
--- a/geode-core/src/main/java/org/apache/geode/cache/query/internal/index/AbstractIndex.java
+++ b/geode-core/src/main/java/org/apache/geode/cache/query/internal/index/AbstractIndex.java
@@ -69,6 +69,7 @@ import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.internal.cache.LocalRegion;
 import org.apache.geode.internal.cache.PartitionedRegion;
 import org.apache.geode.internal.cache.RegionEntry;
+import org.apache.geode.internal.cache.RegionEntryContext;
 import org.apache.geode.internal.cache.partitioned.Bucket;
 import org.apache.geode.internal.cache.persistence.query.CloseableIterator;
 import org.apache.geode.internal.i18n.LocalizedStrings;
@@ -1338,7 +1339,9 @@ public abstract class AbstractIndex implements IndexProtocol {
         valuesInRegion = evaluateIndexIteratorsFromRE(re, context);
         valueInIndex = verifyAndGetPdxDomainObject(value);
       } else {
-        Object val = re.getValueInVM(context.getPartitionedRegion());
+        RegionEntryContext regionEntryContext = context.getPartitionedRegion() != null
+            ? context.getPartitionedRegion() : (RegionEntryContext) region;
+        Object val = re.getValueInVM(regionEntryContext);
         if (val instanceof CachedDeserializable) {
           val = ((CachedDeserializable) val).getDeserializedValue(getRegion(), re);
         }
diff --git a/geode-core/src/main/java/org/apache/geode/cache/snapshot/SnapshotReader.java b/geode-core/src/main/java/org/apache/geode/cache/snapshot/SnapshotReader.java
index be92716..dd0ad37 100644
--- a/geode-core/src/main/java/org/apache/geode/cache/snapshot/SnapshotReader.java
+++ b/geode-core/src/main/java/org/apache/geode/cache/snapshot/SnapshotReader.java
@@ -17,10 +17,15 @@ package org.apache.geode.cache.snapshot;
 import java.io.File;
 import java.io.IOException;
 
+import org.apache.geode.CancelException;
 import org.apache.geode.DataSerializer;
 import org.apache.geode.Instantiator;
+import org.apache.geode.cache.Cache;
+import org.apache.geode.cache.CacheFactory;
+import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.internal.cache.snapshot.GFSnapshot;
 import org.apache.geode.pdx.PdxSerializer;
+import org.apache.geode.pdx.internal.TypeRegistry;
 
 /**
  * Provides utilities for reading cache data.
@@ -47,6 +52,15 @@ public class SnapshotReader {
    */
   public static <K, V> SnapshotIterator<K, V> read(File snapshot)
       throws IOException, ClassNotFoundException {
-    return GFSnapshot.read(snapshot);
+    TypeRegistry typeRegistry = null;
+    try {
+      Cache cache = CacheFactory.getAnyInstance();
+      if (cache != null) {
+        typeRegistry = ((InternalCache) cache).getPdxRegistry();
+      }
+    } catch (CancelException ignore) {
+      // proceed with no type registry
+    }
+    return GFSnapshot.read(snapshot, typeRegistry);
   }
 }
diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/InternalDistributedSystem.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/InternalDistributedSystem.java
index d65f9ff..81f2325 100644
--- a/geode-core/src/main/java/org/apache/geode/distributed/internal/InternalDistributedSystem.java
+++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/InternalDistributedSystem.java
@@ -2647,9 +2647,16 @@ public class InternalDistributedSystem extends DistributedSystem
                   "Stopping the checkrequiredrole thread because reconnect : {} reached the max number of reconnect tries : {}",
                   reconnectAttemptCounter, maxTries);
             }
-            throw new CacheClosedException(
-                LocalizedStrings.InternalDistributedSystem_SOME_REQUIRED_ROLES_MISSING
-                    .toLocalizedString());
+            InternalCache internalCache = dm.getCache();
+            if (internalCache == null) {
+              throw new CacheClosedException(
+                  LocalizedStrings.InternalDistributedSystem_SOME_REQUIRED_ROLES_MISSING
+                      .toLocalizedString());
+            } else {
+              throw internalCache.getCacheClosedException(
+                  LocalizedStrings.InternalDistributedSystem_SOME_REQUIRED_ROLES_MISSING
+                      .toLocalizedString());
+            }
           }
         }
 
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/AbstractDiskRegion.java b/geode-core/src/main/java/org/apache/geode/internal/cache/AbstractDiskRegion.java
index e51af1f..d1f7bd5 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/AbstractDiskRegion.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/AbstractDiskRegion.java
@@ -1052,4 +1052,9 @@ public abstract class AbstractDiskRegion implements DiskRegionView {
   public void incRecentlyUsed() {
     entries.incRecentlyUsed();
   }
+
+  @Override
+  public InternalCache getCache() {
+    return getDiskStore().getCache();
+  }
 }
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/BucketAdvisor.java b/geode-core/src/main/java/org/apache/geode/internal/cache/BucketAdvisor.java
index 1f51b93..fc14773 100755
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/BucketAdvisor.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/BucketAdvisor.java
@@ -1390,7 +1390,7 @@ public class BucketAdvisor extends CacheDistributionAdvisor {
           this.getAdvisee().getCancelCriterion().checkCancelInProgress(null);
           final InternalCache cache = getBucket().getCache();
           if (cache != null && cache.isCacheAtShutdownAll()) {
-            throw new CacheClosedException("Cache is shutting down");
+            throw cache.getCacheClosedException("Cache is shutting down");
           }
 
           if (getBucketRedundancy() == -1) {
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/BucketPersistenceAdvisor.java b/geode-core/src/main/java/org/apache/geode/internal/cache/BucketPersistenceAdvisor.java
index 9972453..1760e02 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/BucketPersistenceAdvisor.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/BucketPersistenceAdvisor.java
@@ -101,7 +101,7 @@ public class BucketPersistenceAdvisor extends PersistenceAdvisorImpl {
   protected void checkInterruptedByShutdownAll() {
     // when ShutdownAll is on-going, break all the GII for BR
     if (proxyBucket.getCache().isCacheAtShutdownAll()) {
-      throw new CacheClosedException("Cache is being closed by ShutdownAll");
+      throw proxyBucket.getCache().getCacheClosedException("Cache is being closed by ShutdownAll");
     }
     proxyBucket.getPartitionedRegion().checkReadiness();
   }
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/BucketRegion.java b/geode-core/src/main/java/org/apache/geode/internal/cache/BucketRegion.java
index 07c27da..9f538a5 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/BucketRegion.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/BucketRegion.java
@@ -720,7 +720,7 @@ public class BucketRegion extends DistributedRegion implements Bucket {
     }
 
     if (cache.isCacheAtShutdownAll()) {
-      throw new CacheClosedException("Cache is shutting down");
+      throw cache.getCacheClosedException("Cache is shutting down");
     }
 
     Object keys[] = new Object[1];
@@ -757,7 +757,7 @@ public class BucketRegion extends DistributedRegion implements Bucket {
       checkForPrimary();
 
       if (cache.isCacheAtShutdownAll()) {
-        throw new CacheClosedException("Cache is shutting down");
+        throw cache.getCacheClosedException("Cache is shutting down");
       }
 
       isPrimary = true;
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/CacheDistributionAdvisor.java b/geode-core/src/main/java/org/apache/geode/internal/cache/CacheDistributionAdvisor.java
index 5dcf6d9..a188750 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/CacheDistributionAdvisor.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/CacheDistributionAdvisor.java
@@ -752,7 +752,8 @@ public class CacheDistributionAdvisor extends DistributionAdvisor {
         LocalRegion lclRgn;
         int oldLevel = LocalRegion.setThreadInitLevelRequirement(LocalRegion.ANY_INIT);
         try {
-          lclRgn = LocalRegion.getRegionFromPath(dm.getSystem(), adviseePath);
+          InternalCache cache = dm.getCache();
+          lclRgn = cache == null ? null : cache.getRegionByPath(adviseePath);
         } finally {
           LocalRegion.setThreadInitLevelRequirement(oldLevel);
         }
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/CacheServerAdvisor.java b/geode-core/src/main/java/org/apache/geode/internal/cache/CacheServerAdvisor.java
index 47b7cb3..d48375b 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/CacheServerAdvisor.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/CacheServerAdvisor.java
@@ -123,7 +123,7 @@ public class CacheServerAdvisor extends GridAdvisor {
       // tell local controllers about this cache server
       tellLocalControllers(removeProfile, exchangeProfiles, replyProfiles);
       // for QRM messaging we need cache servers to know about each other
-      tellLocalBridgeServers(removeProfile, exchangeProfiles, replyProfiles);
+      tellLocalBridgeServers(dm.getCache(), removeProfile, exchangeProfiles, replyProfiles);
     }
 
     @Override
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/CachedDeserializableFactory.java b/geode-core/src/main/java/org/apache/geode/internal/cache/CachedDeserializableFactory.java
index 2ceb616..5d3cf27 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/CachedDeserializableFactory.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/CachedDeserializableFactory.java
@@ -42,11 +42,11 @@ public class CachedDeserializableFactory {
   /**
    * Creates and returns an instance of CachedDeserializable that contains the specified byte array.
    */
-  public static CachedDeserializable create(byte[] v) {
+  public static CachedDeserializable create(byte[] v, InternalCache cache) {
     if (STORE_ALL_VALUE_FORMS) {
       return new StoreAllCachedDeserializable(v);
     } else if (PREFER_DESERIALIZED) {
-      if (isPdxEncoded(v) && cachePrefersPdx()) {
+      if (isPdxEncoded(v) && cachePrefersPdx(cache)) {
         return new PreferBytesCachedDeserializable(v);
       } else {
         return new VMCachedDeserializable(v);
@@ -68,11 +68,12 @@ public class CachedDeserializableFactory {
    * Creates and returns an instance of CachedDeserializable that contains the specified object
    * (that is not a byte[]).
    */
-  public static CachedDeserializable create(Object object, int serializedSize) {
+  public static CachedDeserializable create(Object object, int serializedSize,
+      InternalCache cache) {
     if (STORE_ALL_VALUE_FORMS) {
       return new StoreAllCachedDeserializable(object);
     } else if (PREFER_DESERIALIZED) {
-      if (object instanceof PdxInstance && cachePrefersPdx()) {
+      if (object instanceof PdxInstance && cachePrefersPdx(cache)) {
         return new PreferBytesCachedDeserializable(object);
 
       } else {
@@ -83,8 +84,8 @@ public class CachedDeserializableFactory {
     }
   }
 
-  private static boolean cachePrefersPdx() {
-    InternalCache internalCache = GemFireCacheImpl.getInstance();
+  private static boolean cachePrefersPdx(InternalCache internalCache) {
+    // InternalCache internalCache = GemFireCacheImpl.getInstance();
     return internalCache != null && internalCache.getPdxReadSerialized();
   }
 
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/CloseCacheMessage.java b/geode-core/src/main/java/org/apache/geode/internal/cache/CloseCacheMessage.java
index fccda69..523eaf6 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/CloseCacheMessage.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/CloseCacheMessage.java
@@ -57,7 +57,7 @@ public class CloseCacheMessage extends HighPriorityDistributionMessage implement
     boolean systemError = false;
     try {
       try {
-        PartitionedRegionHelper.cleanUpMetaDataOnNodeFailure(getSender());
+        PartitionedRegionHelper.cleanUpMetaDataOnNodeFailure(dm.getCache(), getSender());
       } catch (VirtualMachineError err) {
         systemError = true;
         SystemFailure.initiateFailure(err);
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/ControllerAdvisor.java b/geode-core/src/main/java/org/apache/geode/internal/cache/ControllerAdvisor.java
index 624edbd..4bf5ba1 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/ControllerAdvisor.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/ControllerAdvisor.java
@@ -114,7 +114,7 @@ public class ControllerAdvisor extends GridAdvisor {
       // tell local controllers about this remote controller
       tellLocalControllers(removeProfile, exchangeProfiles, replyProfiles);
       // tell local bridge servers about this remote controller
-      tellLocalBridgeServers(removeProfile, exchangeProfiles, replyProfiles);
+      tellLocalBridgeServers(dm.getCache(), removeProfile, exchangeProfiles, replyProfiles);
     }
 
     @Override
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/DiskStoreImpl.java b/geode-core/src/main/java/org/apache/geode/internal/cache/DiskStoreImpl.java
index e3ea1fb..4b3bba5 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/DiskStoreImpl.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/DiskStoreImpl.java
@@ -821,7 +821,7 @@ public class DiskStoreImpl implements DiskStore {
           if (bb == CLEAR_BB) {
             return Token.REMOVED_PHASE1;
           }
-          return convertBytesAndBitsIntoObject(bb);
+          return convertBytesAndBitsIntoObject(bb, getCache());
         } catch (IllegalArgumentException e) {
           count++;
           if (logger.isDebugEnabled()) {
@@ -880,13 +880,13 @@ public class DiskStoreImpl implements DiskStore {
    *
    * @return the converted object
    */
-  static Object convertBytesAndBitsIntoObject(BytesAndBits bb) {
+  static Object convertBytesAndBitsIntoObject(BytesAndBits bb, InternalCache cache) {
     byte[] bytes = bb.getBytes();
     Object value;
     if (EntryBits.isInvalid(bb.getBits())) {
       value = Token.INVALID;
     } else if (EntryBits.isSerialized(bb.getBits())) {
-      value = DiskEntry.Helper.readSerializedValue(bytes, bb.getVersion(), null, true);
+      value = DiskEntry.Helper.readSerializedValue(bytes, bb.getVersion(), null, true, cache);
     } else if (EntryBits.isLocalInvalid(bb.getBits())) {
       value = Token.LOCAL_INVALID;
     } else if (EntryBits.isTombstone(bb.getBits())) {
@@ -902,13 +902,13 @@ public class DiskStoreImpl implements DiskStore {
    *
    * @return the converted object
    */
-  static Object convertBytesAndBitsToSerializedForm(BytesAndBits bb) {
+  static Object convertBytesAndBitsToSerializedForm(BytesAndBits bb, InternalCache cache) {
     final byte[] bytes = bb.getBytes();
     Object value;
     if (EntryBits.isInvalid(bb.getBits())) {
       value = Token.INVALID;
     } else if (EntryBits.isSerialized(bb.getBits())) {
-      value = DiskEntry.Helper.readSerializedValue(bytes, bb.getVersion(), null, false);
+      value = DiskEntry.Helper.readSerializedValue(bytes, bb.getVersion(), null, false, cache);
     } else if (EntryBits.isLocalInvalid(bb.getBits())) {
       value = Token.LOCAL_INVALID;
     } else if (EntryBits.isTombstone(bb.getBits())) {
@@ -1029,7 +1029,7 @@ public class DiskStoreImpl implements DiskStore {
       if (opId != -1) {
         OplogSet oplogSet = getOplogSet(dr);
         bb = oplogSet.getChild(opId).getNoBuffer(dr, id);
-        return convertBytesAndBitsIntoObject(bb);
+        return convertBytesAndBitsIntoObject(bb, getCache());
       } else {
         return null;
       }
@@ -1230,7 +1230,7 @@ public class DiskStoreImpl implements DiskStore {
    * @since GemFire 5.7
    */
   public Object getSerializedData(DiskRegion dr, DiskId id) {
-    return convertBytesAndBitsToSerializedForm(getBytesAndBits(dr, id, true));
+    return convertBytesAndBitsToSerializedForm(getBytesAndBits(dr, id, true), dr.getCache());
   }
 
   private void checkForFlusherThreadTermination() {
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/DiskStoreMonitor.java b/geode-core/src/main/java/org/apache/geode/internal/cache/DiskStoreMonitor.java
index 37f4e94..55fcc5a 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/DiskStoreMonitor.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/DiskStoreMonitor.java
@@ -29,7 +29,6 @@ import org.apache.logging.log4j.Logger;
 
 import org.apache.geode.cache.DiskAccessException;
 import org.apache.geode.distributed.internal.DistributionConfig;
-import org.apache.geode.distributed.internal.InternalDistributedSystem;
 import org.apache.geode.internal.i18n.LocalizedStrings;
 import org.apache.geode.internal.logging.LogService;
 import org.apache.geode.internal.logging.LoggingThreadGroup;
@@ -39,9 +38,6 @@ import org.apache.geode.internal.logging.log4j.LogMarker;
 public class DiskStoreMonitor {
   private static final Logger logger = LogService.getLogger();
 
-  private static final boolean DISABLE_MONITOR =
-      Boolean.getBoolean(DistributionConfig.GEMFIRE_PREFIX + "DISK_USAGE_DISABLE_MONITORING");
-
   private static final int USAGE_CHECK_INTERVAL = Integer
       .getInteger(DistributionConfig.GEMFIRE_PREFIX + "DISK_USAGE_POLLING_INTERVAL_MILLIS", 10000);
 
@@ -88,6 +84,11 @@ public class DiskStoreMonitor {
     }
   }
 
+  static final String DISK_USAGE_DISABLE_MONITORING =
+      DistributionConfig.GEMFIRE_PREFIX + "DISK_USAGE_DISABLE_MONITORING";
+
+  private final boolean disableMonitor = Boolean.getBoolean(DISK_USAGE_DISABLE_MONITORING);
+
   private final ScheduledExecutorService exec;
 
   private final Map<DiskStoreImpl, Set<DirectoryHolderUsage>> disks;
@@ -100,20 +101,20 @@ public class DiskStoreMonitor {
     void handleDiskStateChange(DiskState state);
   }
 
-  public DiskStoreMonitor() {
+  public DiskStoreMonitor(File logFile) {
     disks = new ConcurrentHashMap<DiskStoreImpl, Set<DirectoryHolderUsage>>();
-    logDisk = new LogUsage(getLogDir());
+    logDisk = new LogUsage(getLogDir(logFile));
 
     if (logger.isTraceEnabled(LogMarker.DISK_STORE_MONITOR)) {
       logger.trace(LogMarker.DISK_STORE_MONITOR, "Disk monitoring is {}",
-          (DISABLE_MONITOR ? "disabled" : "enabled"));
+          (disableMonitor ? "disabled" : "enabled"));
       logger.trace(LogMarker.DISK_STORE_MONITOR, "Log directory usage warning is set to {}%",
           LOG_WARNING_THRESHOLD_PCT);
       logger.trace(LogMarker.DISK_STORE_MONITOR, "Scheduling disk usage checks every {} ms",
           USAGE_CHECK_INTERVAL);
     }
 
-    if (DISABLE_MONITOR) {
+    if (disableMonitor) {
       exec = null;
     } else {
       final ThreadGroup tg = LoggingThreadGroup.createThreadGroup(
@@ -141,6 +142,10 @@ public class DiskStoreMonitor {
     }
   }
 
+  LogUsage getLogDisk() {
+    return logDisk;
+  }
+
   public void addDiskStore(DiskStoreImpl ds) {
     if (logger.isTraceEnabled(LogMarker.DISK_STORE_MONITOR)) {
       logger.trace(LogMarker.DISK_STORE_MONITOR, "Now monitoring disk store {}", ds.getName());
@@ -209,27 +214,17 @@ public class DiskStoreMonitor {
     logDisk.update(LOG_WARNING_THRESHOLD_PCT, 100);
   }
 
-  private File getLogDir() {
-    File log = null;
-    InternalCache internalCache = GemFireCacheImpl.getInstance();
-    if (internalCache != null) {
-      InternalDistributedSystem ds = internalCache.getInternalDistributedSystem();
-      if (ds != null) {
-        DistributionConfig conf = ds.getConfig();
-        if (conf != null) {
-          log = conf.getLogFile();
-          if (log != null) {
-            log = log.getParentFile();
-          }
-        }
-      }
+  private static File getLogDir(File logFile) {
+    File logDir = null;
+    if (logFile != null) {
+      logDir = logFile.getParentFile();
     }
 
-    if (log == null) {
+    if (logDir == null) {
       // assume current directory
-      log = new File(".");
+      logDir = new File(".");
     }
-    return log;
+    return logDir;
   }
 
   abstract static class DiskUsage {
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/DistTXState.java b/geode-core/src/main/java/org/apache/geode/internal/cache/DistTXState.java
index 30850bc..8276316 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/DistTXState.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/DistTXState.java
@@ -22,6 +22,7 @@ import java.util.Map.Entry;
 import java.util.Set;
 import java.util.TreeMap;
 
+import org.apache.geode.InternalGemFireException;
 import org.apache.geode.InvalidDeltaException;
 import org.apache.geode.SystemFailure;
 import org.apache.geode.cache.CacheWriterException;
@@ -368,11 +369,20 @@ public class DistTXState extends TXState {
         }
         dtop.setDistributedMember(sender);
         dtop.setOriginRemote(false);
+
         /*
          * [DISTTX} TODO handle call back argument version tag and other settings in PutMessage
          */
         String failureReason = null;
         try {
+          if (dtop.getRegion() == null) {
+            // Tx event from the peer.
+            if (dtop.getRegionName() == null) {
+              throw new InternalGemFireException("Region is unavailable on DistTxEntryEvent.");
+            }
+            dtop.setRegion((LocalRegion) getCache().getRegion(dtop.getRegionName()));
+          }
+
           if (dtop.getKeyInfo().isDistKeyInfo()) {
             dtop.getKeyInfo().setCheckPrimary(false);
           } else {
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/DistTXStateProxyImpl.java b/geode-core/src/main/java/org/apache/geode/internal/cache/DistTXStateProxyImpl.java
index 32f23ac..59aeaa2 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/DistTXStateProxyImpl.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/DistTXStateProxyImpl.java
@@ -19,23 +19,18 @@ import org.apache.logging.log4j.Logger;
 import org.apache.geode.distributed.internal.membership.InternalDistributedMember;
 import org.apache.geode.internal.logging.LogService;
 
-/**
- *
- *
- */
 public abstract class DistTXStateProxyImpl extends TXStateProxyImpl {
 
   protected static final Logger logger = LogService.getLogger();
 
-  public DistTXStateProxyImpl(TXManagerImpl managerImpl, TXId id,
+  public DistTXStateProxyImpl(InternalCache cache, TXManagerImpl managerImpl, TXId id,
       InternalDistributedMember clientMember) {
-    super(managerImpl, id, clientMember);
-    // TODO Auto-generated constructor stub
+    super(cache, managerImpl, id, clientMember);
   }
 
-  public DistTXStateProxyImpl(TXManagerImpl managerImpl, TXId id, boolean isjta) {
-    super(managerImpl, id, isjta);
-    // TODO Auto-generated constructor stub
+  public DistTXStateProxyImpl(InternalCache cache, TXManagerImpl managerImpl, TXId id,
+      boolean isjta) {
+    super(cache, managerImpl, id, isjta);
   }
 
   @Override
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/DistTXStateProxyImplOnCoordinator.java b/geode-core/src/main/java/org/apache/geode/internal/cache/DistTXStateProxyImplOnCoordinator.java
index a477d6c..6778b12 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/DistTXStateProxyImplOnCoordinator.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/DistTXStateProxyImplOnCoordinator.java
@@ -44,19 +44,23 @@ public class DistTXStateProxyImplOnCoordinator extends DistTXStateProxyImpl {
    * A map of distributed system member to either {@link DistPeerTXStateStub} or
    * {@link DistTXStateOnCoordinator} (in case of TX coordinator is also a data node)
    */
-  protected HashMap<DistributedMember, DistTXCoordinatorInterface> target2realDeals =
+  private final HashMap<DistributedMember, DistTXCoordinatorInterface> target2realDeals =
       new HashMap<>();
+
   private HashMap<LocalRegion, DistributedMember> rrTargets;
+
   private Set<DistributedMember> txRemoteParticpants = null; // other than local
-  protected HashMap<String, ArrayList<DistTxThinEntryState>> txEntryEventMap = null;
 
-  public DistTXStateProxyImplOnCoordinator(TXManagerImpl managerImpl, TXId id,
+  private HashMap<String, ArrayList<DistTxThinEntryState>> txEntryEventMap = null;
+
+  public DistTXStateProxyImplOnCoordinator(InternalCache cache, TXManagerImpl managerImpl, TXId id,
       InternalDistributedMember clientMember) {
-    super(managerImpl, id, clientMember);
+    super(cache, managerImpl, id, clientMember);
   }
 
-  public DistTXStateProxyImplOnCoordinator(TXManagerImpl managerImpl, TXId id, boolean isjta) {
-    super(managerImpl, id, isjta);
+  public DistTXStateProxyImplOnCoordinator(InternalCache cache, TXManagerImpl managerImpl, TXId id,
+      boolean isjta) {
+    super(cache, managerImpl, id, isjta);
   }
 
   /*
@@ -128,10 +132,8 @@ public class DistTXStateProxyImplOnCoordinator extends DistTXStateProxyImpl {
    * those
    */
   private HashMap<DistributedMember, DistTXCoordinatorInterface> getSecondariesAndReplicasForTxOps() {
-    final GemFireCacheImpl cache =
-        GemFireCacheImpl.getExisting("getSecondariesAndReplicasForTxOps");
     InternalDistributedMember currentNode =
-        cache.getInternalDistributedSystem().getDistributedMember();
+        getCache().getInternalDistributedSystem().getDistributedMember();
 
     HashMap<DistributedMember, DistTXCoordinatorInterface> secondaryTarget2realDeals =
         new HashMap<>();
@@ -192,8 +194,7 @@ public class DistTXStateProxyImplOnCoordinator extends DistTXStateProxyImpl {
     }
 
     boolean finalResult = false;
-    final GemFireCacheImpl cache = GemFireCacheImpl.getExisting("Applying Dist TX Rollback");
-    final DistributionManager dm = cache.getDistributionManager();
+    final DistributionManager dm = getCache().getDistributionManager();
     try {
       // Create Tx Participants
       Set<DistributedMember> txRemoteParticpants = getTxRemoteParticpants(dm);
@@ -331,7 +332,8 @@ public class DistTXStateProxyImplOnCoordinator extends DistTXStateProxyImpl {
         // Code to keep going forward
         if (r.hasServerProxy()) {
           // TODO [DISTTX] See what we need for client?
-          this.realDeal = new DistClientTXStateStub(this, target, r);
+          this.realDeal =
+              new DistClientTXStateStub(r.getCache(), r.getDistributionManager(), this, target, r);
           if (r.scope.isDistributed()) {
             if (txDistributedClientWarningIssued.compareAndSet(false, true)) {
               logger.warn(LocalizedMessage.create(
@@ -434,8 +436,7 @@ public class DistTXStateProxyImplOnCoordinator extends DistTXStateProxyImpl {
 
   private boolean doPrecommit() {
     boolean finalResult = true;
-    final GemFireCacheImpl cache = GemFireCacheImpl.getExisting("Applying Dist TX Precommit");
-    final DistributionManager dm = cache.getDistributionManager();
+    final DistributionManager dm = getCache().getDistributionManager();
     Set<DistributedMember> txRemoteParticpants = getTxRemoteParticpants(dm);
 
     // create processor and precommit message
@@ -619,8 +620,7 @@ public class DistTXStateProxyImplOnCoordinator extends DistTXStateProxyImpl {
    */
   private boolean doCommit() {
     boolean finalResult = true;
-    final GemFireCacheImpl cache = GemFireCacheImpl.getExisting("Applying Dist TX Commit");
-    final DistributionManager dm = cache.getDistributionManager();
+    final DistributionManager dm = getCache().getDistributionManager();
 
     // Create Tx Participants
     Set<DistributedMember> txRemoteParticpants = getTxRemoteParticpants(dm);
@@ -936,8 +936,7 @@ public class DistTXStateProxyImplOnCoordinator extends DistTXStateProxyImpl {
   public DistributedMember getOwnerForKey(LocalRegion r, KeyInfo key) {
     DistributedMember m = r.getOwnerForKey(key);
     if (m == null) {
-      GemFireCacheImpl cache = GemFireCacheImpl.getExisting("getOwnerForKey");
-      m = cache.getDistributedSystem().getDistributedMember();
+      m = getCache().getDistributedSystem().getDistributedMember();
     }
     return m;
   }
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/DistTXStateProxyImplOnDatanode.java b/geode-core/src/main/java/org/apache/geode/internal/cache/DistTXStateProxyImplOnDatanode.java
index 12a2b07..6cd2503 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/DistTXStateProxyImplOnDatanode.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/DistTXStateProxyImplOnDatanode.java
@@ -29,13 +29,14 @@ public class DistTXStateProxyImplOnDatanode extends DistTXStateProxyImpl {
   private DistTXPrecommitMessage preCommitMessage = null;
   private boolean preCommitResponse = false;
 
-  public DistTXStateProxyImplOnDatanode(TXManagerImpl managerImpl, TXId id,
+  public DistTXStateProxyImplOnDatanode(InternalCache cache, TXManagerImpl managerImpl, TXId id,
       InternalDistributedMember clientMember) {
-    super(managerImpl, id, clientMember);
+    super(cache, managerImpl, id, clientMember);
   }
 
-  public DistTXStateProxyImplOnDatanode(TXManagerImpl managerImpl, TXId id, boolean isjta) {
-    super(managerImpl, id, isjta);
+  public DistTXStateProxyImplOnDatanode(InternalCache cache, TXManagerImpl managerImpl, TXId id,
+      boolean isjta) {
+    super(cache, managerImpl, id, isjta);
   }
 
   @Override
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/DistributedPutAllOperation.java b/geode-core/src/main/java/org/apache/geode/internal/cache/DistributedPutAllOperation.java
index 9b3effd..16f4be9 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/DistributedPutAllOperation.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/DistributedPutAllOperation.java
@@ -335,7 +335,7 @@ public class DistributedPutAllOperation extends AbstractUpdateOperation {
       } else {
         byte[] bb = DataSerializer.readByteArray(in);
         if ((flgs & IS_CACHED_DESER) != 0) {
-          this.value = CachedDeserializableFactory.create(bb);
+          this.value = CachedDeserializableFactory.create(bb, GemFireCacheImpl.getInstance());
         } else {
           this.value = bb;
         }
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/DistributedRegionFunctionStreamingMessage.java b/geode-core/src/main/java/org/apache/geode/internal/cache/DistributedRegionFunctionStreamingMessage.java
index d7605e5..3e2e0c5 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/DistributedRegionFunctionStreamingMessage.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/DistributedRegionFunctionStreamingMessage.java
@@ -138,8 +138,15 @@ public class DistributedRegionFunctionStreamingMessage extends DistributionMessa
 
     try {
       if (checkCacheClosing(dm) || checkDSClosing(dm)) {
-        thr = new CacheClosedException(LocalizedStrings.PartitionMessage_REMOTE_CACHE_IS_CLOSED_0
-            .toLocalizedString(dm.getId()));
+        InternalCache cache = dm.getCache();
+        if (cache != null) {
+          thr = cache
+              .getCacheClosedException(LocalizedStrings.PartitionMessage_REMOTE_CACHE_IS_CLOSED_0
+                  .toLocalizedString(dm.getId()));
+        } else {
+          thr = new CacheClosedException(LocalizedStrings.PartitionMessage_REMOTE_CACHE_IS_CLOSED_0
+              .toLocalizedString(dm.getId()));
+        }
         return;
       }
       dr = (DistributedRegion) dm.getCache().getRegion(this.regionPath);
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/EntryEventImpl.java b/geode-core/src/main/java/org/apache/geode/internal/cache/EntryEventImpl.java
index bac2373..575417a 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/EntryEventImpl.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/EntryEventImpl.java
@@ -209,7 +209,8 @@ public class EntryEventImpl
       if (in.readBoolean()) { // newValueSerialized
         this.newValueBytes = DataSerializer.readByteArray(in);
         this.cachedSerializedNewValue = this.newValueBytes;
-        this.newValue = CachedDeserializableFactory.create(this.newValueBytes);
+        this.newValue =
+            CachedDeserializableFactory.create(this.newValueBytes, GemFireCacheImpl.getInstance());
       } else {
         this.newValue = DataSerializer.readObject(in);
       }
@@ -219,7 +220,8 @@ public class EntryEventImpl
     // code needs to change.
     if (in.readBoolean()) { // oldValueSerialized
       this.oldValueBytes = DataSerializer.readByteArray(in);
-      this.oldValue = CachedDeserializableFactory.create(this.oldValueBytes);
+      this.oldValue =
+          CachedDeserializableFactory.create(this.oldValueBytes, GemFireCacheImpl.getInstance());
     } else {
       this.oldValue = DataSerializer.readObject(in);
     }
@@ -514,7 +516,7 @@ public class EntryEventImpl
     setEventFlag(EventFlags.FLAG_LOCAL_INVALID, b);
   }
 
-  void setGenerateCallbacks(boolean b) {
+  public void setGenerateCallbacks(boolean b) {
     setEventFlag(EventFlags.FLAG_GENERATE_CALLBACKS, b);
   }
 
@@ -801,7 +803,7 @@ public class EntryEventImpl
   public Object getRawNewValueAsHeapObject() {
     Object result = basicGetNewValue();
     if (mayHaveOffHeapReferences()) {
-      result = OffHeapHelper.copyIfNeeded(result);
+      result = OffHeapHelper.copyIfNeeded(result, getRegion().getCache());
     }
     return result;
   }
@@ -953,7 +955,7 @@ public class EntryEventImpl
   public Object getRawOldValueAsHeapObject() {
     Object result = basicGetOldValue();
     if (mayHaveOffHeapReferences()) {
-      result = OffHeapHelper.copyIfNeeded(result);
+      result = OffHeapHelper.copyIfNeeded(result, getRegion().getCache());
     }
     return result;
   }
@@ -1440,10 +1442,6 @@ public class EntryEventImpl
     basicSetNewValue(getCachedDeserializable(obj, this));
   }
 
-  public static Object getCachedDeserializable(Object obj) {
-    return getCachedDeserializable(obj, null);
-  }
-
   public static Object getCachedDeserializable(Object obj, EntryEventImpl ev) {
     if (obj instanceof byte[] || obj == null || obj instanceof CachedDeserializable
         || obj == Token.NOT_AVAILABLE || Token.isInvalidOrRemoved(obj)
@@ -1464,10 +1462,10 @@ public class EntryEventImpl
           objSize += Sizeable.PER_OBJECT_OVERHEAD;
         }
       }
-      cd = CachedDeserializableFactory.create(obj, objSize);
+      cd = CachedDeserializableFactory.create(obj, objSize, ev.getRegion().getCache());
     } else {
       final byte[] b = serialize(obj);
-      cd = CachedDeserializableFactory.create(b);
+      cd = CachedDeserializableFactory.create(b, ev.getRegion().getCache());
       if (ev != null) {
         ev.newValueBytes = b;
         ev.cachedSerializedNewValue = b;
@@ -1487,7 +1485,7 @@ public class EntryEventImpl
   public void setSerializedNewValue(byte[] serializedValue) {
     Object newVal = null;
     if (serializedValue != null) {
-      newVal = CachedDeserializableFactory.create(serializedValue);
+      newVal = CachedDeserializableFactory.create(serializedValue, getRegion().getCache());
     }
     this.newValueBytes = serializedValue;
     basicSetNewValue(newVal);
@@ -1498,7 +1496,7 @@ public class EntryEventImpl
     this.oldValueBytes = serializedOldValue;
     final Object ov;
     if (serializedOldValue != null) {
-      ov = CachedDeserializableFactory.create(serializedOldValue);
+      ov = CachedDeserializableFactory.create(serializedOldValue, getRegion().getCache());
     } else {
       ov = null;
     }
@@ -1645,7 +1643,7 @@ public class EntryEventImpl
       } else {
         vSize = CachedDeserializableFactory.calcMemSize(v, region.getObjectSizer(), false);
       }
-      v = CachedDeserializableFactory.create(v, vSize);
+      v = CachedDeserializableFactory.create(v, vSize, region.getCache());
       basicSetNewValue(v);
     }
 
@@ -1784,7 +1782,7 @@ public class EntryEventImpl
         } else {
           valueSize = old.getValueSizeInBytes();
         }
-        value = CachedDeserializableFactory.create(value, valueSize);
+        value = CachedDeserializableFactory.create(value, valueSize, getRegion().getCache());
       }
       setNewValue(value);
       if (this.causedByMessage != null && this.causedByMessage instanceof PutMessage) {
@@ -1828,7 +1826,7 @@ public class EntryEventImpl
       // fix for bug 34387
       Object pv = v;
       if (mayHaveOffHeapReferences()) {
-        pv = OffHeapHelper.copyIfNeeded(v);
+        pv = OffHeapHelper.copyIfNeeded(v, getRegion().getCache());
       }
       tx.setPendingValue(pv);
     }
@@ -2844,16 +2842,16 @@ public class EntryEventImpl
       if (StoredObject.isOffHeapReference(ov)) {
         if (ReferenceCountHelper.trackReferenceCounts()) {
           ReferenceCountHelper.setReferenceCountOwner(new OldValueOwner());
-          this.oldValue = OffHeapHelper.copyAndReleaseIfNeeded(ov);
+          this.oldValue = OffHeapHelper.copyAndReleaseIfNeeded(ov, getRegion().getCache());
           ReferenceCountHelper.setReferenceCountOwner(null);
         } else {
-          this.oldValue = OffHeapHelper.copyAndReleaseIfNeeded(ov);
+          this.oldValue = OffHeapHelper.copyAndReleaseIfNeeded(ov, getRegion().getCache());
         }
       }
       Object nv = basicGetNewValue();
       if (StoredObject.isOffHeapReference(nv)) {
         ReferenceCountHelper.setReferenceCountOwner(this);
-        this.newValue = OffHeapHelper.copyAndReleaseIfNeeded(nv);
+        this.newValue = OffHeapHelper.copyAndReleaseIfNeeded(nv, getRegion().getCache());
         ReferenceCountHelper.setReferenceCountOwner(null);
       }
       if (StoredObject.isOffHeapReference(this.newValue)
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/GemFireCacheImpl.java b/geode-core/src/main/java/org/apache/geode/internal/cache/GemFireCacheImpl.java
index 894621a..d86e547 100755
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/GemFireCacheImpl.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/GemFireCacheImpl.java
@@ -711,7 +711,7 @@ public class GemFireCacheImpl implements InternalCache, InternalClientCache, Has
     }
     if (result != null) {
       throw result.getCacheClosedException(
-          LocalizedStrings.CacheFactory_THE_CACHE_HAS_BEEN_CLOSED.toLocalizedString(), null);
+          LocalizedStrings.CacheFactory_THE_CACHE_HAS_BEEN_CLOSED.toLocalizedString());
     }
     throw new CacheClosedException(
         LocalizedStrings.CacheFactory_A_CACHE_HAS_NOT_YET_BEEN_CREATED.toLocalizedString());
@@ -957,7 +957,7 @@ public class GemFireCacheImpl implements InternalCache, InternalClientCache, Has
 
       SystemFailure.signalCacheCreate();
 
-      this.diskMonitor = new DiskStoreMonitor();
+      this.diskMonitor = new DiskStoreMonitor(system.getConfig().getLogFile());
 
       addRegionEntrySynchronizationListener(new GatewaySenderQueueEntrySynchronizationListener());
     } // synchronized
@@ -1569,6 +1569,12 @@ public class GemFireCacheImpl implements InternalCache, InternalClientCache, Has
 
   /** return a CacheClosedException with the given reason */
   @Override
+  public CacheClosedException getCacheClosedException(String reason) {
+    return getCacheClosedException(reason, null);
+  }
+
+  /** return a CacheClosedException with the given reason and cause */
+  @Override
   public CacheClosedException getCacheClosedException(String reason, Throwable cause) {
     CacheClosedException result;
     if (cause != null) {
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/GridAdvisor.java b/geode-core/src/main/java/org/apache/geode/internal/cache/GridAdvisor.java
index 12acc2e..3c15fe9 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/GridAdvisor.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/GridAdvisor.java
@@ -204,7 +204,8 @@ public abstract class GridAdvisor extends DistributionAdvisor {
       // Exchange with any local servers or controllers.
       List<Profile> otherProfiles = new ArrayList<Profile>();
       GridProfile profile = (GridProfile) createProfile();
-      profile.tellLocalBridgeServers(false, true, otherProfiles);
+      profile.tellLocalBridgeServers(getDistributionManager().getCache(), false, true,
+          otherProfiles);
       profile.tellLocalControllers(false, true, otherProfiles);
       for (Profile otherProfile : otherProfiles) {
         if (!otherProfile.equals(profile)) {
@@ -223,7 +224,7 @@ public abstract class GridAdvisor extends DistributionAdvisor {
       // Notify any local bridge servers or controllers
       // that we are closing.
       GridProfile profile = (GridProfile) createProfile();
-      profile.tellLocalBridgeServers(true, false, null);
+      profile.tellLocalBridgeServers(getDistributionManager().getCache(), true, false, null);
       profile.tellLocalControllers(true, false, null);
       super.close();
     } catch (DistributedSystemDisconnectedException ignore) {
@@ -325,9 +326,9 @@ public abstract class GridAdvisor extends DistributionAdvisor {
      *
      * @since GemFire 5.7
      */
-    protected void tellLocalBridgeServers(boolean removeProfile, boolean exchangeProfiles,
-        final List<Profile> replyProfiles) {
-      final InternalCache cache = GemFireCacheImpl.getInstance();
+    protected void tellLocalBridgeServers(InternalCache cache, boolean removeProfile,
+        boolean exchangeProfiles, final List<Profile> replyProfiles) {
+
       if (cache != null && !cache.isClosed()) {
         List<?> bridgeServers = cache.getCacheServersAndGatewayReceiver();
         for (int i = 0; i < bridgeServers.size(); i++) {
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/InitialImageOperation.java b/geode-core/src/main/java/org/apache/geode/internal/cache/InitialImageOperation.java
index a9ef94c..84d633d 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/InitialImageOperation.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/InitialImageOperation.java
@@ -15,14 +15,34 @@
 
 package org.apache.geode.internal.cache;
 
-import java.io.*;
-import java.util.*;
+import java.io.DataInput;
+import java.io.DataOutput;
+import java.io.Externalizable;
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+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.concurrent.TimeoutException;
 import java.util.concurrent.atomic.AtomicInteger;
 
 import org.apache.logging.log4j.Logger;
 
-import org.apache.geode.*;
+import org.apache.geode.CancelException;
+import org.apache.geode.DataSerializable;
+import org.apache.geode.DataSerializer;
+import org.apache.geode.InternalGemFireError;
+import org.apache.geode.InternalGemFireException;
+import org.apache.geode.SystemFailure;
 import org.apache.geode.cache.DiskAccessException;
 import org.apache.geode.cache.RegionDestroyedException;
 import org.apache.geode.cache.query.internal.CqStateImpl;
@@ -30,10 +50,23 @@ import org.apache.geode.cache.query.internal.DefaultQueryService;
 import org.apache.geode.cache.query.internal.cq.CqService;
 import org.apache.geode.cache.query.internal.cq.ServerCQ;
 import org.apache.geode.distributed.DistributedMember;
-import org.apache.geode.distributed.DistributedSystem;
-import org.apache.geode.distributed.internal.*;
+import org.apache.geode.distributed.internal.ClusterDistributionManager;
+import org.apache.geode.distributed.internal.DistributionConfig;
+import org.apache.geode.distributed.internal.DistributionManager;
+import org.apache.geode.distributed.internal.DistributionMessage;
+import org.apache.geode.distributed.internal.HighPriorityDistributionMessage;
+import org.apache.geode.distributed.internal.InternalDistributedSystem;
+import org.apache.geode.distributed.internal.MessageWithReply;
+import org.apache.geode.distributed.internal.ReplyException;
+import org.apache.geode.distributed.internal.ReplyMessage;
+import org.apache.geode.distributed.internal.ReplyProcessor21;
 import org.apache.geode.distributed.internal.membership.InternalDistributedMember;
-import org.apache.geode.internal.*;
+import org.apache.geode.internal.Assert;
+import org.apache.geode.internal.ByteArrayDataInput;
+import org.apache.geode.internal.DataSerializableFixedID;
+import org.apache.geode.internal.InternalDataSerializer;
+import org.apache.geode.internal.NullDataOutputStream;
+import org.apache.geode.internal.Version;
 import org.apache.geode.internal.cache.InitialImageFlowControl.FlowControlPermitMessage;
 import org.apache.geode.internal.cache.entries.DiskEntry;
 import org.apache.geode.internal.cache.ha.HAContainerWrapper;
@@ -43,7 +76,13 @@ import org.apache.geode.internal.cache.tier.InterestType;
 import org.apache.geode.internal.cache.tier.sockets.CacheClientNotifier;
 import org.apache.geode.internal.cache.tier.sockets.CacheClientProxy;
 import org.apache.geode.internal.cache.tier.sockets.ClientProxyMembershipID;
-import org.apache.geode.internal.cache.versions.*;
+import org.apache.geode.internal.cache.versions.DiskRegionVersionVector;
+import org.apache.geode.internal.cache.versions.DiskVersionTag;
+import org.apache.geode.internal.cache.versions.RegionVersionHolder;
+import org.apache.geode.internal.cache.versions.RegionVersionVector;
+import org.apache.geode.internal.cache.versions.VersionSource;
+import org.apache.geode.internal.cache.versions.VersionStamp;
+import org.apache.geode.internal.cache.versions.VersionTag;
 import org.apache.geode.internal.cache.vmotion.VMotionObserverHolder;
 import org.apache.geode.internal.cache.wan.AbstractGatewaySender;
 import org.apache.geode.internal.i18n.LocalizedStrings;
@@ -874,7 +913,8 @@ public class InitialImageOperation {
                   continue;
                 }
                 if (entry.isSerialized() && !Token.isInvalidOrRemoved(tmpValue)) {
-                  tmpValue = CachedDeserializableFactory.create((byte[]) tmpValue);
+                  tmpValue =
+                      CachedDeserializableFactory.create((byte[]) tmpValue, region.getCache());
                 }
                 try {
                   if (tag != null) {
@@ -919,7 +959,7 @@ public class InitialImageOperation {
           if (tmpValue == null) {
             tmpValue = entry.isLocalInvalid() ? Token.LOCAL_INVALID : Token.INVALID;
           } else if (entry.isSerialized()) {
-            tmpValue = CachedDeserializableFactory.create((byte[]) tmpValue);
+            tmpValue = CachedDeserializableFactory.create((byte[]) tmpValue, region.getCache());
           }
           try {
             // null IDs in a version tag are meant to mean "this member", so
@@ -1434,13 +1474,12 @@ public class InitialImageOperation {
     int initLevel = targetReinitialized ? LocalRegion.AFTER_INITIAL_IMAGE : LocalRegion.ANY_INIT;
     int oldLevel = LocalRegion.setThreadInitLevelRequirement(initLevel);
     try {
-      DistributedSystem system = dm.getSystem();
-      // GemFireCache cache = (GemFireCache)CacheFactory.getInstance(system);
       if (isDebugEnabled) {
         logger.debug("RequestImageMessage: attempting to get region reference for {}, initLevel={}",
             regionPath, initLevel);
       }
-      lclRgn = LocalRegion.getRegionFromPath(system, regionPath);
+      InternalCache cache = dm.getCache();
+      lclRgn = cache == null ? null : cache.getRegionByPath(regionPath);
       // if this is a targeted getInitialImage after a region was initialized,
       // make sure this is the region that was reinitialized.
       if (lclRgn != null && !lclRgn.isUsedForPartitionedRegionBucket() && targetReinitialized
@@ -1463,7 +1502,7 @@ public class InitialImageOperation {
       return null;
     }
 
-    if (lclRgn.scope.isLocal()) {
+    if (lclRgn.getScope().isLocal()) {
       if (isDebugEnabled) {
         logger.debug("local scope region, nothing to do");
       }
@@ -2196,8 +2235,8 @@ public class InitialImageOperation {
       ReplyException rex = null;
       try {
         Assert.assertTrue(this.regionPath != null, "Region path is null.");
-        DistributedSystem system = dm.getSystem();
-        lclRgn = LocalRegion.getRegionFromPath(system, this.regionPath);
+        InternalCache cache = dm.getCache();
+        lclRgn = cache == null ? null : cache.getRegionByPath(regionPath);
 
         if (lclRgn == null) {
           if (logger.isDebugEnabled()) {
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/InternalCache.java b/geode-core/src/main/java/org/apache/geode/internal/cache/InternalCache.java
index 1d92370..d872037 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/InternalCache.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/InternalCache.java
@@ -164,6 +164,8 @@ public interface InternalCache extends Cache, Extensible<Cache>, CacheTime {
 
   boolean keepDurableSubscriptionsAlive();
 
+  CacheClosedException getCacheClosedException(String reason);
+
   CacheClosedException getCacheClosedException(String reason, Throwable cause);
 
   TypeRegistry getPdxRegistry();
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/LocalRegion.java b/geode-core/src/main/java/org/apache/geode/internal/cache/LocalRegion.java
index aa0f8c6..7bc04da 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/LocalRegion.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/LocalRegion.java
@@ -144,7 +144,6 @@ import org.apache.geode.cache.query.internal.index.IndexUtils;
 import org.apache.geode.cache.util.ObjectSizer;
 import org.apache.geode.cache.wan.GatewaySender;
 import org.apache.geode.distributed.DistributedMember;
-import org.apache.geode.distributed.DistributedSystem;
 import org.apache.geode.distributed.internal.DistributionAdvisor;
 import org.apache.geode.distributed.internal.DistributionAdvisor.Profile;
 import org.apache.geode.distributed.internal.DistributionConfig;
@@ -2264,21 +2263,6 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
   }
 
   /**
-   * Look up the LocalRegion with the specified full path.
-   *
-   * @param system the distributed system whose cache contains the root of interest
-   * @return the LocalRegion or null if not found
-   */
-  static LocalRegion getRegionFromPath(DistributedSystem system, String path) {
-    Cache cache = GemFireCacheImpl.getInstance();
-    if (cache == null) {
-      return null;
-    } else {
-      return (LocalRegion) cache.getRegion(path);
-    }
-  }
-
-  /**
    * Do any extra initialization required. Region is already visible in parent's subregion map. This
    * method releases the initialization Latches, so subclasses should call this super method last
    * after performing additional initialization.
@@ -4312,7 +4296,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
             }
 
             if (val instanceof byte[] && !isBytes) {
-              val = CachedDeserializableFactory.create((byte[]) val);
+              val = CachedDeserializableFactory.create((byte[]) val, getCache());
             }
 
             if (isTombstone) {
@@ -7364,7 +7348,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
       if (this.reinitialized_old) {
         regionDestroyedException = new RegionReinitializedException(toString(), getFullPath());
       } else if (this.cache.isCacheAtShutdownAll()) {
-        throw new CacheClosedException("Cache is being closed by ShutdownAll");
+        throw cache.getCacheClosedException("Cache is being closed by ShutdownAll");
       } else {
         regionDestroyedException = new RegionDestroyedException(toString(), getFullPath());
       }
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/MemberFunctionStreamingMessage.java b/geode-core/src/main/java/org/apache/geode/internal/cache/MemberFunctionStreamingMessage.java
index 2269677..85ab9a8 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/MemberFunctionStreamingMessage.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/MemberFunctionStreamingMessage.java
@@ -167,9 +167,15 @@ public class MemberFunctionStreamingMessage extends DistributionMessage
       if (this.regionPathSet != null) {
         for (String regionPath : this.regionPathSet) {
           if (checkCacheClosing(dm) || checkDSClosing(dm)) {
-            thr =
-                new CacheClosedException(LocalizedStrings.PartitionMessage_REMOTE_CACHE_IS_CLOSED_0
-                    .toLocalizedString(dm.getId()));
+            if (dm.getCache() == null) {
+              thr = new CacheClosedException(
+                  LocalizedStrings.PartitionMessage_REMOTE_CACHE_IS_CLOSED_0
+                      .toLocalizedString(dm.getId()));
+            } else {
+              dm.getCache().getCacheClosedException(
+                  LocalizedStrings.PartitionMessage_REMOTE_CACHE_IS_CLOSED_0
+                      .toLocalizedString(dm.getId()));
+            }
             return;
           }
           regions.add(cache.getRegion(regionPath));
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/Oplog.java b/geode-core/src/main/java/org/apache/geode/internal/cache/Oplog.java
index b3f6f6f..412789f 100755
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/Oplog.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/Oplog.java
@@ -2360,7 +2360,8 @@ public class Oplog implements CompactableOplog, Flushable {
         value = Token.INVALID;
         valueLength = 0;
       } else if (EntryBits.isSerialized(userBits)) {
-        value = DiskEntry.Helper.readSerializedValue(valueBytes, version, in, false);
+        value = DiskEntry.Helper.readSerializedValue(valueBytes, version, in, false,
+            getParent().getCache());
       } else if (EntryBits.isTombstone(userBits)) {
         value = Token.TOMBSTONE;
       } else {
@@ -2862,7 +2863,8 @@ public class Oplog implements CompactableOplog, Flushable {
         // make sure values are deserializable
         if (!PdxWriterImpl.isPdx(valueBytes)) { // fix bug 43011
           try {
-            DiskEntry.Helper.readSerializedValue(valueBytes, version, in, true);
+            DiskEntry.Helper.readSerializedValue(valueBytes, version, in, true,
+                getParent().getCache());
           } catch (SerializationException ex) {
             if (logger.isDebugEnabled()) {
               logger.debug("Could not deserialize recovered value: {}", ex.getCause(), ex);
@@ -3601,7 +3603,8 @@ public class Oplog implements CompactableOplog, Flushable {
           useNextOplog = true;
         } else {
           if (this.lockedForKRFcreate) {
-            CacheClosedException cce = new CacheClosedException("The disk store is closed.");
+            CacheClosedException cce =
+                getParent().getCache().getCacheClosedException("The disk store is closed.");
             dr.getCancelCriterion().checkCancelInProgress(cce);
             throw cce;
           }
@@ -4631,7 +4634,8 @@ public class Oplog implements CompactableOplog, Flushable {
             useNextOplog = true;
           } else {
             if (this.lockedForKRFcreate) {
-              CacheClosedException cce = new CacheClosedException("The disk store is closed.");
+              CacheClosedException cce =
+                  getParent().getCache().getCacheClosedException("The disk store is closed.");
               dr.getCancelCriterion().checkCancelInProgress(cce);
               throw cce;
             }
@@ -4758,7 +4762,8 @@ public class Oplog implements CompactableOplog, Flushable {
             useNextOplog = true;
           } else {
             if (this.lockedForKRFcreate) {
-              CacheClosedException cce = new CacheClosedException("The disk store is closed.");
+              CacheClosedException cce =
+                  getParent().getCache().getCacheClosedException("The disk store is closed.");
               dr.getCancelCriterion().checkCancelInProgress(cce);
               throw cce;
             }
@@ -5076,7 +5081,8 @@ public class Oplog implements CompactableOplog, Flushable {
           useNextOplog = true;
         } else {
           if (this.lockedForKRFcreate) {
-            CacheClosedException cce = new CacheClosedException("The disk store is closed.");
+            CacheClosedException cce =
+                parent.getCache().getCacheClosedException("The disk store is closed.");
             dr.getCancelCriterion().checkCancelInProgress(cce);
             throw cce;
           }
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/PRHARedundancyProvider.java b/geode-core/src/main/java/org/apache/geode/internal/cache/PRHARedundancyProvider.java
index 9ae327c..d551248 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/PRHARedundancyProvider.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/PRHARedundancyProvider.java
@@ -508,7 +508,7 @@ public class PRHARedundancyProvider {
 
     synchronized (this) {
       if (this.prRegion.getCache().isCacheAtShutdownAll()) {
-        throw new CacheClosedException("Cache is shutting down");
+        throw prRegion.getCache().getCacheClosedException("Cache is shutting down");
       }
 
       if (isDebugEnabled) {
@@ -551,7 +551,7 @@ public class PRHARedundancyProvider {
             if (isDebugEnabled) {
               logger.debug("Aborted createBucketAtomically due to ShutdownAll");
             }
-            throw new CacheClosedException("Cache is shutting down");
+            throw prRegion.getCache().getCacheClosedException("Cache is shutting down");
           }
           // this.prRegion.getCache().getLogger().config(
           // "DEBUG createBucketAtomically: "
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionAttributesImpl.java b/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionAttributesImpl.java
index e97e983..37ad335 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionAttributesImpl.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionAttributesImpl.java
@@ -651,11 +651,10 @@ public class PartitionAttributesImpl implements PartitionAttributes, Cloneable,
    *
    * @since GemFire 5.8Beta
    */
-  void validateColocation() {
+  void validateColocation(Cache cache) {
     if (this.colocatedRegionName == null) {
       return;
     }
-    Cache cache = GemFireCacheImpl.getInstance();
     if (cache != null) {
       Region<?, ?> region = cache.getRegion(this.colocatedRegionName);
       if (region == null) {
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionRegionConfigValidator.java b/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionRegionConfigValidator.java
index 9f08f99..726cea6 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionRegionConfigValidator.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionRegionConfigValidator.java
@@ -301,7 +301,7 @@ public class PartitionRegionConfigValidator {
     final PartitionAttributesImpl userPA =
         (PartitionAttributesImpl) pr.getAttributes().getPartitionAttributes();
 
-    userPA.validateColocation(); // do this here to fix bug 47197
+    userPA.validateColocation(pr.getCache()); // do this here to fix bug 47197
 
     PartitionedRegion colocatedPR = ColocationHelper.getColocatedRegion(pr);
     if (colocatedPR != null) {
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegion.java b/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegion.java
index d655c16..347a114 100755
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegion.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegion.java
@@ -595,14 +595,6 @@ public class PartitionedRegion extends LocalRegion
     }
 
     public Object getRegion(Object key) throws PRLocallyDestroyedException {
-      if (cleared) {
-        Cache cache = GemFireCacheImpl.getInstance();
-        if (cache == null) {
-          throw new CacheClosedException();
-        } else {
-          cache.getCancelCriterion().checkCancelInProgress(null);
-        }
-      }
       Assert.assertTrue(key instanceof Integer);
 
       Object o = super.get(key);
@@ -975,7 +967,7 @@ public class PartitionedRegion extends LocalRegion
     }
     /* Initialize the PartitionRegion */
     if (cache.isCacheAtShutdownAll()) {
-      throw new CacheClosedException("Cache is shutting down");
+      throw cache.getCacheClosedException("Cache is shutting down");
     }
     validator.validateColocation();
 
@@ -2156,7 +2148,7 @@ public class PartitionedRegion extends LocalRegion
     final boolean isDebugEnabled = logger.isDebugEnabled();
 
     if (cache.isCacheAtShutdownAll()) {
-      throw new CacheClosedException("Cache is shutting down");
+      throw cache.getCacheClosedException("Cache is shutting down");
     }
 
     final long startTime = PartitionedRegionStats.startTime();
@@ -2248,7 +2240,7 @@ public class PartitionedRegion extends LocalRegion
     final boolean isDebugEnabled = logger.isDebugEnabled();
 
     if (cache.isCacheAtShutdownAll()) {
-      throw new CacheClosedException("Cache is shutting down");
+      throw cache.getCacheClosedException("Cache is shutting down");
     }
 
     final long startTime = PartitionedRegionStats.startTime();
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegionHelper.java b/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegionHelper.java
index cb0fd0c..592e16f 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegionHelper.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegionHelper.java
@@ -271,7 +271,7 @@ public class PartitionedRegionHelper {
         root = (DistributedRegion) cache.createVMRegion(PR_ROOT_REGION_NAME, ra,
             new InternalRegionArguments().setIsUsedForPartitionedRegionAdmin(true)
                 .setInternalRegion(true).setCachePerfStatsHolder(prMetaStatsHolder));
-        root.getDistributionAdvisor().addMembershipListener(new MemberFailureListener());
+        root.getDistributionAdvisor().addMembershipListener(new MemberFailureListener(cache));
       } catch (RegionExistsException ignore) {
         // we avoid this before hand, but yet we have to catch it
         root = (DistributedRegion) cache.getRegion(PR_ROOT_REGION_NAME, true);
@@ -305,15 +305,13 @@ public class PartitionedRegionHelper {
    * Clean the config meta data for a DistributedMember which has left the DistributedSystem, one
    * PartitionedRegion at a time.
    */
-  public static void cleanUpMetaDataOnNodeFailure(DistributedMember failedMemId) {
+  public static void cleanUpMetaDataOnNodeFailure(InternalCache cache,
+      DistributedMember failedMemId) {
     try {
-      final InternalCache cache = GemFireCacheImpl.getInstance();
       if (cache == null || cache.getCancelCriterion().isCancelInProgress()) {
         return;
       }
 
-      DistributionManager dm = cache.getInternalDistributedSystem().getDistributionManager();
-
       if (logger.isDebugEnabled()) {
         logger.debug("Cleaning PartitionedRegion meta data for memberId={}", failedMemId);
       }
@@ -932,12 +930,18 @@ public class PartitionedRegionHelper {
 
   private static class MemberFailureListener implements MembershipListener {
 
+    InternalCache cache = null;
+
+    MemberFailureListener(InternalCache cache) {
+      this.cache = cache;
+    }
+
     public void memberJoined(InternalDistributedMember id) {
 
     }
 
     public void memberDeparted(final InternalDistributedMember id, boolean crashed) {
-      PartitionedRegionHelper.cleanUpMetaDataOnNodeFailure(id);
+      PartitionedRegionHelper.cleanUpMetaDataOnNodeFailure(cache, id);
     }
 
     public void memberSuspect(InternalDistributedMember id, InternalDistributedMember whoSuspected,
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/PausedTXStateProxyImpl.java b/geode-core/src/main/java/org/apache/geode/internal/cache/PausedTXStateProxyImpl.java
index de9e91e..a948376 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/PausedTXStateProxyImpl.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/PausedTXStateProxyImpl.java
@@ -19,7 +19,6 @@ import java.util.List;
 import java.util.Set;
 import java.util.concurrent.locks.ReentrantLock;
 
-import org.apache.geode.cache.Cache;
 import org.apache.geode.cache.CommitConflictException;
 import org.apache.geode.cache.EntryNotFoundException;
 import org.apache.geode.cache.Region.Entry;
@@ -90,7 +89,7 @@ public class PausedTXStateProxyImpl implements TXStateProxy {
   }
 
   @Override
-  public Cache getCache() {
+  public InternalCache getCache() {
     return null;
   }
 
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/RegionEntryContext.java b/geode-core/src/main/java/org/apache/geode/internal/cache/RegionEntryContext.java
index 2b2d7f9..32a3d50 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/RegionEntryContext.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/RegionEntryContext.java
@@ -39,4 +39,6 @@ public interface RegionEntryContext extends HasCachePerfStats {
   boolean getOffHeap();
 
   void incRecentlyUsed();
+
+  InternalCache getCache();
 }
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/RemoteGetMessage.java b/geode-core/src/main/java/org/apache/geode/internal/cache/RemoteGetMessage.java
index 306b00e..e4ca109 100755
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/RemoteGetMessage.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/RemoteGetMessage.java
@@ -381,7 +381,8 @@ public class RemoteGetMessage extends RemoteOperationMessageWithDirectReply {
           if (reply.valueIsByteArray) {
             return reply.valueInBytes;
           } else if (preferCD) {
-            return CachedDeserializableFactory.create(reply.valueInBytes);
+            return CachedDeserializableFactory.create(reply.valueInBytes,
+                getDistributionManager().getCache());
           } else {
             return BlobHelper.deserializeBlob(reply.valueInBytes, reply.remoteVersion, null);
           }
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/RemoteOperationMessage.java b/geode-core/src/main/java/org/apache/geode/internal/cache/RemoteOperationMessage.java
index 985138f..e3424af 100755
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/RemoteOperationMessage.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/RemoteOperationMessage.java
@@ -195,12 +195,18 @@ public abstract class RemoteOperationMessage extends DistributionMessage
     LocalRegion r = null;
     long startTime = 0;
     try {
+      InternalCache cache = getCache(dm);
       if (checkCacheClosing(dm) || checkDSClosing(dm)) {
-        thr = new CacheClosedException(LocalizedStrings.PartitionMessage_REMOTE_CACHE_IS_CLOSED_0
-            .toLocalizedString(dm.getId()));
+        if (cache == null) {
+          thr = new CacheClosedException(LocalizedStrings.PartitionMessage_REMOTE_CACHE_IS_CLOSED_0
+              .toLocalizedString(dm.getId()));
+        } else {
+          thr = cache
+              .getCacheClosedException(LocalizedStrings.PartitionMessage_REMOTE_CACHE_IS_CLOSED_0
+                  .toLocalizedString(dm.getId()));
+        }
         return;
       }
-      InternalCache cache = getCache(dm);
       r = getRegionByPath(cache);
       if (r == null && failIfRegionMissing()) {
         // if the distributed system is disconnecting, don't send a reply saying
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/TXCommitMessage.java b/geode-core/src/main/java/org/apache/geode/internal/cache/TXCommitMessage.java
index 3cb9209..4a74abf 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/TXCommitMessage.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/TXCommitMessage.java
@@ -1172,9 +1172,9 @@ public class TXCommitMessage extends PooledDistributionMessage
     }
 
     private boolean hookupRegion(DistributionManager dm) {
-      this.r = LocalRegion.getRegionFromPath(dm.getSystem(), this.regionPath);
+      this.r = getRegionByPath(dm, regionPath);
       if (this.r == null && this.parentRegionPath != null) {
-        this.r = LocalRegion.getRegionFromPath(dm.getSystem(), this.parentRegionPath);
+        this.r = getRegionByPath(dm, this.parentRegionPath);
         this.regionPath = this.parentRegionPath;
       }
       if (this.r == null && dm.getSystem().isLoner()) {
@@ -1186,6 +1186,11 @@ public class TXCommitMessage extends PooledDistributionMessage
       return true;
     }
 
+    LocalRegion getRegionByPath(DistributionManager dm, String regionPath) {
+      InternalCache cache = dm.getCache();
+      return cache == null ? null : cache.getRegionByPath(regionPath);
+    }
+
     /**
      * Called when processing is complete; only needs to be called if beginProcess returned true.
      */
@@ -1355,7 +1360,7 @@ public class TXCommitMessage extends PooledDistributionMessage
 
 
     public boolean isForceFireEvent(DistributionManager dm) {
-      LocalRegion r = LocalRegion.getRegionFromPath(dm.getSystem(), this.regionPath);
+      LocalRegion r = getRegionByPath(dm, regionPath);
       if (r instanceof PartitionedRegion || (r != null && r.isUsedForPartitionedRegionBucket())) {
         return false;
       }
@@ -1524,7 +1529,8 @@ public class TXCommitMessage extends PooledDistributionMessage
             if (isToken) {
               this.value = DataSerializer.readObject(in);
             } else {
-              this.value = CachedDeserializableFactory.create(DataSerializer.readByteArray(in));
+              this.value = CachedDeserializableFactory.create(DataSerializer.readByteArray(in),
+                  GemFireCacheImpl.getInstance());
             }
           }
         }
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/TXManagerImpl.java b/geode-core/src/main/java/org/apache/geode/internal/cache/TXManagerImpl.java
index 1fdabd9..c73c18c 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/TXManagerImpl.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/TXManagerImpl.java
@@ -328,9 +328,9 @@ public class TXManagerImpl implements CacheTransactionManager, MembershipListene
     TXId id = new TXId(this.distributionMgrId, this.uniqId.incrementAndGet());
     TXStateProxyImpl proxy = null;
     if (isDistributed()) {
-      proxy = new DistTXStateProxyImplOnCoordinator(this, id, null);
+      proxy = new DistTXStateProxyImplOnCoordinator(cache, this, id, null);
     } else {
-      proxy = new TXStateProxyImpl(this, id, null);
+      proxy = new TXStateProxyImpl(cache, this, id, null);
     }
     setTXState(proxy);
     this.localTxMap.put(id, proxy);
@@ -348,9 +348,9 @@ public class TXManagerImpl implements CacheTransactionManager, MembershipListene
     TXStateProxy newState = null;
 
     if (isDistributed()) {
-      newState = new DistTXStateProxyImplOnCoordinator(this, id, true);
+      newState = new DistTXStateProxyImplOnCoordinator(cache, this, id, true);
     } else {
-      newState = new TXStateProxyImpl(this, id, true);
+      newState = new TXStateProxyImpl(cache, this, id, true);
     }
     setTXState(newState);
     return newState;
@@ -877,10 +877,10 @@ public class TXManagerImpl implements CacheTransactionManager, MembershipListene
         val = this.hostedTXStates.get(key);
         if (val == null && msg.canStartRemoteTransaction()) {
           if (msg.isTransactionDistributed()) {
-            val = new DistTXStateProxyImplOnDatanode(this, key, msg.getTXOriginatorClient());
+            val = new DistTXStateProxyImplOnDatanode(cache, this, key, msg.getTXOriginatorClient());
             val.setLocalTXState(new DistTXState(val, true));
           } else {
-            val = new TXStateProxyImpl(this, key, msg.getTXOriginatorClient());
+            val = new TXStateProxyImpl(cache, this, key, msg.getTXOriginatorClient());
             val.setLocalTXState(new TXState(val, true));
           }
           this.hostedTXStates.put(key, val);
@@ -942,10 +942,10 @@ public class TXManagerImpl implements CacheTransactionManager, MembershipListene
           // TODO: Conditionally create object based on distributed or non-distributed tx mode
           if (msg instanceof TransactionMessage
               && ((TransactionMessage) msg).isTransactionDistributed()) {
-            val = new DistTXStateProxyImplOnDatanode(this, key, memberId);
+            val = new DistTXStateProxyImplOnDatanode(cache, this, key, memberId);
             // val.setLocalTXState(new DistTXState(val,true));
           } else {
-            val = new TXStateProxyImpl(this, key, memberId);
+            val = new TXStateProxyImpl(cache, this, key, memberId);
             // val.setLocalTXState(new TXState(val,true));
           }
           this.hostedTXStates.put(key, val);
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/TXMessage.java b/geode-core/src/main/java/org/apache/geode/internal/cache/TXMessage.java
index c26c71e..338cddf 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/TXMessage.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/TXMessage.java
@@ -75,8 +75,14 @@ public abstract class TXMessage extends SerialDistributionMessage
       }
       InternalCache cache = dm.getCache();
       if (checkCacheClosing(cache) || checkDSClosing(cache.getInternalDistributedSystem())) {
-        thr = new CacheClosedException(LocalizedStrings.PartitionMessage_REMOTE_CACHE_IS_CLOSED_0
-            .toLocalizedString(dm.getId()));
+        if (cache == null) {
+          thr = new CacheClosedException(LocalizedStrings.PartitionMessage_REMOTE_CACHE_IS_CLOSED_0
+              .toLocalizedString(dm.getId()));
+        } else {
+          thr = cache
+              .getCacheClosedException(LocalizedStrings.PartitionMessage_REMOTE_CACHE_IS_CLOSED_0
+                  .toLocalizedString(dm.getId()));
+        }
         return;
       }
       TXManagerImpl txMgr = cache.getTXMgr();
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/TXRegionLockRequestImpl.java b/geode-core/src/main/java/org/apache/geode/internal/cache/TXRegionLockRequestImpl.java
index 1e586aa..ca33352 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/TXRegionLockRequestImpl.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/TXRegionLockRequestImpl.java
@@ -23,6 +23,7 @@ import java.util.Set;
 import org.apache.logging.log4j.Logger;
 
 import org.apache.geode.DataSerializer;
+import org.apache.geode.annotations.TestingOnly;
 import org.apache.geode.cache.CacheClosedException;
 import org.apache.geode.internal.InternalDataSerializer;
 import org.apache.geode.internal.cache.locks.TXRegionLockRequest;
@@ -38,6 +39,8 @@ public class TXRegionLockRequestImpl implements TXRegionLockRequest {
   private static final long serialVersionUID = 5840033961584078082L;
   private static final Logger logger = LogService.getLogger();
 
+  private transient InternalCache cache;
+
   private transient LocalRegion r;
 
   private String regionPath;
@@ -46,9 +49,11 @@ public class TXRegionLockRequestImpl implements TXRegionLockRequest {
 
   public TXRegionLockRequestImpl() {
     // for DataSerializer
+    this.cache = null;
   }
 
-  public TXRegionLockRequestImpl(LocalRegion r) {
+  public TXRegionLockRequestImpl(InternalCache cache, LocalRegion r) {
+    this.cache = cache;
     this.r = r;
     this.regionPath = null;
     this.entryKeys = null;
@@ -57,7 +62,9 @@ public class TXRegionLockRequestImpl implements TXRegionLockRequest {
   /**
    * Used by unit tests
    */
+  @TestingOnly
   public TXRegionLockRequestImpl(String regionPath, Set<Object> entryKeys) {
+    this.cache = null;
     this.regionPath = regionPath;
     this.entryKeys = entryKeys;
   }
@@ -66,6 +73,7 @@ public class TXRegionLockRequestImpl implements TXRegionLockRequest {
     return this.entryKeys == null || this.entryKeys.isEmpty();
   }
 
+  @Override
   public void addEntryKeys(Set<Object> s) {
     if (s == null || s.isEmpty()) {
       return;
@@ -85,6 +93,7 @@ public class TXRegionLockRequestImpl implements TXRegionLockRequest {
     }
   }
 
+  @Override
   public void addEntryKey(Object key) {
     if (this.entryKeys == null) {
       this.entryKeys = new HashSet<Object>();
@@ -92,10 +101,11 @@ public class TXRegionLockRequestImpl implements TXRegionLockRequest {
     this.entryKeys.add(key);
   }
 
+  @Override
   public void fromData(DataInput in) throws IOException, ClassNotFoundException {
     this.regionPath = DataSerializer.readString(in);
 
-    final InternalCache cache = getCache(false);
+    cache = GemFireCacheImpl.getInstance();
     try {
       final int size = InternalDataSerializer.readArrayLength(in);
       if (cache != null && size > 0) {
@@ -129,6 +139,7 @@ public class TXRegionLockRequestImpl implements TXRegionLockRequest {
     return set;
   }
 
+  @Override
   public void toData(DataOutput out) throws IOException {
     DataSerializer.writeString(getRegionFullPath(), out);
     InternalDataSerializer.writeSet(this.entryKeys, out);
@@ -141,6 +152,7 @@ public class TXRegionLockRequestImpl implements TXRegionLockRequest {
     return result;
   }
 
+  @Override
   public String getRegionFullPath() {
     if (this.regionPath == null) {
       this.regionPath = this.r.getFullPath();
@@ -148,28 +160,15 @@ public class TXRegionLockRequestImpl implements TXRegionLockRequest {
     return this.regionPath;
   }
 
+  @Override
   public Set<Object> getKeys() {
     if (this.entryKeys == null) {
       // check for cache closed/closing
-      getCache(true);
+      cache.getCancelCriterion().checkCancelInProgress(null);
     }
     return this.entryKeys;
   }
 
-  private InternalCache getCache(boolean throwIfClosing) {
-    final InternalCache cache = GemFireCacheImpl.getInstance();
-    if (cache != null && !cache.isClosed()) {
-      if (throwIfClosing) {
-        cache.getCancelCriterion().checkCancelInProgress(null);
-      }
-      return cache;
-    }
-    if (throwIfClosing) {
-      throw cache.getCacheClosedException("The cache is closed.", null);
-    }
-    return null;
-  }
-
   /**
    * Only safe to call in the vm that creates this request. Once it is serialized this method will
    * return null.
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/TXRegionState.java b/geode-core/src/main/java/org/apache/geode/internal/cache/TXRegionState.java
index 7d16574..20febe9 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/TXRegionState.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/TXRegionState.java
@@ -222,7 +222,7 @@ public class TXRegionState {
     final boolean distributedTX = !byPassDLock && r.getScope().isDistributedAck();
     if (this.uaMods != null || (!distributedTX && this.entryMods.size() > 0)) {
       // need some local locks
-      TXRegionLockRequestImpl rlr = new TXRegionLockRequestImpl(r);
+      TXRegionLockRequestImpl rlr = new TXRegionLockRequestImpl(r.getCache(), r);
       if (this.uaMods != null) {
         rlr.addEntryKeys(this.uaMods.keySet());
       }
@@ -235,7 +235,7 @@ public class TXRegionState {
     }
     if (distributedTX && this.entryMods.size() > 0) {
       // need some distributed locks
-      TXRegionLockRequestImpl rlr = new TXRegionLockRequestImpl(r);
+      TXRegionLockRequestImpl rlr = new TXRegionLockRequestImpl(r.getCache(), r);
       rlr.addEntryKeys(getLockRequestEntryKeys());
       if (!rlr.isEmpty()) {
         req.setOtherMembers(this.otherMembers);
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/TXState.java b/geode-core/src/main/java/org/apache/geode/internal/cache/TXState.java
index b7f4c3e..0fa64cd 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/TXState.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/TXState.java
@@ -1180,8 +1180,8 @@ public class TXState implements TXStateInterface {
    *
    * @see org.apache.geode.internal.cache.TXStateInterface#getCache()
    */
-  public Cache getCache() {
-    return this.proxy.getTxMgr().getCache();
+  public InternalCache getCache() {
+    return this.proxy.getCache();
   }
 
   /*
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/TXStateInterface.java b/geode-core/src/main/java/org/apache/geode/internal/cache/TXStateInterface.java
index 07db839..64304b4 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/TXStateInterface.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/TXStateInterface.java
@@ -23,7 +23,6 @@ import java.util.concurrent.locks.ReentrantLock;
 
 import javax.transaction.Synchronization;
 
-import org.apache.geode.cache.Cache;
 import org.apache.geode.cache.CommitConflictException;
 import org.apache.geode.cache.Region.Entry;
 import org.apache.geode.cache.TransactionId;
@@ -34,7 +33,6 @@ import org.apache.geode.internal.cache.tx.TransactionalOperation.ServerRegionOpe
 
 /**
  * An entity that tracks transactions must implement this interface.
- *
  */
 public interface TXStateInterface extends Synchronization, InternalDataView {
 
@@ -100,7 +98,7 @@ public interface TXStateInterface extends Synchronization, InternalDataView {
 
 
   /** Implement TransactionEvent's getCache */
-  public Cache getCache();
+  public InternalCache getCache();
 
   public Collection<LocalRegion> getRegions();
 
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/TXStateProxyImpl.java b/geode-core/src/main/java/org/apache/geode/internal/cache/TXStateProxyImpl.java
index 7e0fea4..64be4af 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/TXStateProxyImpl.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/TXStateProxyImpl.java
@@ -76,14 +76,41 @@ public class TXStateProxyImpl implements TXStateProxy {
    */
   private Map<Integer, Boolean> buckets = new HashMap<Integer, Boolean>();
 
+  protected volatile TXStateInterface realDeal;
+
+  protected boolean inProgress = true;
+
+  protected InternalDistributedMember onBehalfOfClientMember = null;
+
+  private final InternalCache cache;
+
+  public TXStateProxyImpl(InternalCache cache, TXManagerImpl managerImpl, TXId id,
+      InternalDistributedMember clientMember) {
+    this.cache = cache;
+    this.txMgr = managerImpl;
+    this.txId = id;
+    this.isJTA = false;
+    this.onBehalfOfClientMember = clientMember;
+  }
+
+  public TXStateProxyImpl(InternalCache cache, TXManagerImpl managerImpl, TXId id, boolean isjta) {
+    this.cache = cache;
+    this.txMgr = managerImpl;
+    this.txId = id;
+    this.isJTA = isjta;
+  }
+
+  @Override
   public void setSynchronizationRunnable(TXSynchronizationRunnable synch) {
     this.synchRunnable = synch;
   }
 
+  @Override
   public TXSynchronizationRunnable getSynchronizationRunnable() {
     return this.synchRunnable;
   }
 
+  @Override
   public ReentrantLock getLock() {
     return this.lock;
   }
@@ -92,20 +119,16 @@ public class TXStateProxyImpl implements TXStateProxy {
     return isJTA;
   }
 
+  @Override
   public TXId getTxId() {
     return txId;
   }
 
+  @Override
   public TXManagerImpl getTxMgr() {
     return txMgr;
   }
 
-  protected volatile TXStateInterface realDeal;
-
-  protected boolean inProgress = true;
-
-  protected InternalDistributedMember onBehalfOfClientMember = null;
-
   /**
    * This returns either the TXState for the current transaction or a proxy for the state if it is
    * held in another member. If no state currently exists, one is created
@@ -121,7 +144,8 @@ public class TXStateProxyImpl implements TXStateProxy {
       } else {
         // Code to keep going forward
         if (r.hasServerProxy()) {
-          this.realDeal = new ClientTXStateStub(this, target, r);
+          this.realDeal =
+              new ClientTXStateStub(r.getCache(), r.getDistributionManager(), this, target, r);
           if (r.scope.isDistributed()) {
             if (txDistributedClientWarningIssued.compareAndSet(false, true)) {
               logger.warn(LocalizedMessage.create(
@@ -168,32 +192,21 @@ public class TXStateProxyImpl implements TXStateProxy {
     return this.realDeal;
   }
 
-  public TXStateProxyImpl(TXManagerImpl managerImpl, TXId id,
-      InternalDistributedMember clientMember) {
-    this.txMgr = managerImpl;
-    this.txId = id;
-    this.isJTA = false;
-    this.onBehalfOfClientMember = clientMember;
-  }
-
-  public TXStateProxyImpl(TXManagerImpl managerImpl, TXId id, boolean isjta) {
-    this.txMgr = managerImpl;
-    this.txId = id;
-    this.isJTA = isjta;
-  }
-
   protected void setTXIDForReplay(TXId id) {
     this.txId = id;
   }
 
+  @Override
   public boolean isOnBehalfOfClient() {
     return this.onBehalfOfClientMember != null;
   }
 
+  @Override
   public void setIsJTA(boolean isJTA) {
     this.isJTA = isJTA;
   }
 
+  @Override
   public void checkJTA(String errmsg) throws IllegalStateException {
     if (isJTA()) {
       throw new IllegalStateException(errmsg);
@@ -208,6 +221,7 @@ public class TXStateProxyImpl implements TXStateProxy {
             .toLocalizedString("precommit"));
   }
 
+  @Override
   public void commit() throws CommitConflictException {
     boolean preserveTx = false;
     try {
@@ -244,6 +258,7 @@ public class TXStateProxyImpl implements TXStateProxy {
     return (TransactionException) e;
   }
 
+  @Override
   public boolean containsValueForKey(KeyInfo keyInfo, LocalRegion region) {
     try {
       this.operationCount++;
@@ -266,6 +281,7 @@ public class TXStateProxyImpl implements TXStateProxy {
     }
   }
 
+  @Override
   public void destroyExistingEntry(EntryEventImpl event, boolean cacheWrite,
       Object expectedOldValue) throws EntryNotFoundException {
     try {
@@ -278,19 +294,23 @@ public class TXStateProxyImpl implements TXStateProxy {
     }
   }
 
+  @Override
   public long getBeginTime() {
     return getRealDeal(null, null).getBeginTime();
   }
 
-  public Cache getCache() {
-    return txMgr.getCache();
+  @Override
+  public InternalCache getCache() {
+    return cache;
   }
 
+  @Override
   public int getChanges() {
     assertBootstrapped();
     return getRealDeal(null, null).getChanges();
   }
 
+  @Override
   public Object getDeserializedValue(KeyInfo keyInfo, LocalRegion localRegion, boolean updateStats,
       boolean disableCopyOnRead, boolean preferCD, EntryEventImpl clientEvent,
       boolean returnTombstones, boolean retainResult) {
@@ -304,6 +324,7 @@ public class TXStateProxyImpl implements TXStateProxy {
     return val;
   }
 
+  @Override
   public Entry getEntry(KeyInfo keyInfo, LocalRegion region, boolean allowTombstones) {
     try {
       this.operationCount++;
@@ -315,25 +336,30 @@ public class TXStateProxyImpl implements TXStateProxy {
     }
   }
 
+  @Override
   public TXEvent getEvent() {
     assertBootstrapped();
     return getRealDeal(null, null).getEvent();
   }
 
+  @Override
   public List getEvents() {
     assertBootstrapped();
     return getRealDeal(null, null).getEvents();
   }
 
+  @Override
   public Collection<LocalRegion> getRegions() {
     assertBootstrapped();
     return getRealDeal(null, null).getRegions();
   }
 
+  @Override
   public TransactionId getTransactionId() {
     return txId;
   }
 
+  @Override
   public void invalidateExistingEntry(EntryEventImpl event, boolean invokeCallbacks,
       boolean forceNewEntry) {
     try {
@@ -346,6 +372,7 @@ public class TXStateProxyImpl implements TXStateProxy {
     }
   }
 
+  @Override
   public boolean isInProgress() {
     return inProgress;
   }
@@ -355,26 +382,31 @@ public class TXStateProxyImpl implements TXStateProxy {
     this.inProgress = progress;
   }
 
+  @Override
   public boolean needsLargeModCount() {
     assertBootstrapped();
     return getRealDeal(null, null).needsLargeModCount();
   }
 
+  @Override
   public int nextModSerialNum() {
     assertBootstrapped();
     return getRealDeal(null, null).nextModSerialNum();
   }
 
+  @Override
   public TXRegionState readRegion(LocalRegion r) {
     assertBootstrapped();
     return getRealDeal(null, r).readRegion(r);
   }
 
+  @Override
   public void rmRegion(LocalRegion r) {
     assertBootstrapped();
     getRealDeal(null, r).rmRegion(r);
   }
 
+  @Override
   public void rollback() {
     try {
       getRealDeal(null, null).rollback();
@@ -386,6 +418,7 @@ public class TXStateProxyImpl implements TXStateProxy {
     }
   }
 
+  @Override
   public boolean txPutEntry(EntryEventImpl event, boolean ifNew, boolean requireOldValue,
       boolean checkResources, Object expectedOldValue) {
     try {
@@ -399,6 +432,7 @@ public class TXStateProxyImpl implements TXStateProxy {
     }
   }
 
+  @Override
   public TXEntryState txReadEntry(KeyInfo keyInfo, LocalRegion localRegion, boolean rememberRead,
       boolean createTxEntryIfAbsent) {
     try {
@@ -412,15 +446,18 @@ public class TXStateProxyImpl implements TXStateProxy {
     }
   }
 
+  @Override
   public TXRegionState txReadRegion(LocalRegion localRegion) {
     assertBootstrapped();
     return getRealDeal(null, localRegion).txReadRegion(localRegion);
   }
 
+  @Override
   public TXRegionState txWriteRegion(LocalRegion localRegion, KeyInfo entryKey) {
     return getRealDeal(entryKey, localRegion).txWriteRegion(localRegion, entryKey);
   }
 
+  @Override
   public TXRegionState writeRegion(LocalRegion r) {
     assertBootstrapped();
     return getRealDeal(null, r).writeRegion(r);
@@ -430,6 +467,7 @@ public class TXStateProxyImpl implements TXStateProxy {
     assert realDeal != null;
   }
 
+  @Override
   public void afterCompletion(int status) {
     assertBootstrapped();
     try {
@@ -442,11 +480,13 @@ public class TXStateProxyImpl implements TXStateProxy {
     }
   }
 
+  @Override
   public void beforeCompletion() {
     assertBootstrapped();
     getRealDeal(null, null).beforeCompletion();
   }
 
+  @Override
   public boolean containsKey(KeyInfo keyInfo, LocalRegion localRegion) {
     try {
       this.operationCount++;
@@ -458,6 +498,7 @@ public class TXStateProxyImpl implements TXStateProxy {
     }
   }
 
+  @Override
   @edu.umd.cs.findbugs.annotations.SuppressWarnings(value = "UL_UNRELEASED_LOCK",
       justification = "This method unlocks and then conditionally undoes the unlock in the finally-block. Review again at later time.")
   public int entryCount(LocalRegion localRegion) {
@@ -487,6 +528,7 @@ public class TXStateProxyImpl implements TXStateProxy {
     }
   }
 
+  @Override
   public Object findObject(KeyInfo key, LocalRegion r, boolean isCreate, boolean generateCallbacks,
       Object value, boolean disableCopyOnRead, boolean preferCD,
       ClientProxyMembershipID requestingClient, EntryEventImpl clientEvent,
@@ -502,6 +544,7 @@ public class TXStateProxyImpl implements TXStateProxy {
     }
   }
 
+  @Override
   public Set getAdditionalKeysForIterator(LocalRegion currRgn) {
     if (this.realDeal == null) {
       return null;
@@ -512,6 +555,7 @@ public class TXStateProxyImpl implements TXStateProxy {
   protected final boolean restoreSetOperationTransactionBehavior =
       SystemPropertyHelper.restoreSetOperationTransactionBehavior();
 
+  @Override
   public Object getEntryForIterator(KeyInfo key, LocalRegion currRgn, boolean rememberReads,
       boolean allowTombstones) {
     boolean resetTxState = isTransactionInternalSuspendNeeded(currRgn);
@@ -538,6 +582,7 @@ public class TXStateProxyImpl implements TXStateProxy {
     return resetTxState;
   }
 
+  @Override
   public Object getKeyForIterator(KeyInfo keyInfo, LocalRegion currRgn, boolean rememberReads,
       boolean allowTombstones) {
     boolean resetTxState = isTransactionInternalSuspendNeeded(currRgn);
@@ -559,16 +604,19 @@ public class TXStateProxyImpl implements TXStateProxy {
     }
   }
 
+  @Override
   public Object getValueInVM(KeyInfo keyInfo, LocalRegion localRegion, boolean rememberRead) {
     this.operationCount++;
     return getRealDeal(keyInfo, localRegion).getValueInVM(keyInfo, localRegion, rememberRead);
   }
 
+  @Override
   public boolean isDeferredStats() {
     assertBootstrapped();
     return getRealDeal(null, null).isDeferredStats();
   }
 
+  @Override
   public boolean putEntry(EntryEventImpl event, boolean ifNew, boolean ifOld,
       Object expectedOldValue, boolean requireOldValue, long lastModified,
       boolean overwriteDestroyed) {
@@ -583,14 +631,17 @@ public class TXStateProxyImpl implements TXStateProxy {
     }
   }
 
+  @Override
   public boolean isInProgressAndSameAs(TXStateInterface otherState) {
     return isInProgress() && otherState == this;
   }
 
+  @Override
   public void setLocalTXState(TXStateInterface state) {
     this.realDeal = state;
   }
 
+  @Override
   public Object getSerializedValue(LocalRegion localRegion, KeyInfo key, boolean doNotLockEntry,
       ClientProxyMembershipID requestingClient, EntryEventImpl clientEvent,
       boolean returnTombstones) throws DataLocationException {
@@ -599,6 +650,7 @@ public class TXStateProxyImpl implements TXStateProxy {
         requestingClient, clientEvent, returnTombstones);
   }
 
+  @Override
   public boolean putEntryOnRemote(EntryEventImpl event, boolean ifNew, boolean ifOld,
       Object expectedOldValue, boolean requireOldValue, long lastModified,
       boolean overwriteDestroyed) throws DataLocationException {
@@ -609,10 +661,12 @@ public class TXStateProxyImpl implements TXStateProxy {
         overwriteDestroyed);
   }
 
+  @Override
   public boolean isFireCallbacks() {
     return getRealDeal(null, null).isFireCallbacks();
   }
 
+  @Override
   public void destroyOnRemote(EntryEventImpl event, boolean cacheWrite, Object expectedOldValue)
       throws DataLocationException {
     this.operationCount++;
@@ -621,6 +675,7 @@ public class TXStateProxyImpl implements TXStateProxy {
     tx.destroyOnRemote(event, cacheWrite, expectedOldValue);
   }
 
+  @Override
   public void invalidateOnRemote(EntryEventImpl event, boolean invokeCallbacks,
       boolean forceNewEntry) throws DataLocationException {
     this.operationCount++;
@@ -629,11 +684,13 @@ public class TXStateProxyImpl implements TXStateProxy {
     tx.invalidateOnRemote(event, invokeCallbacks, forceNewEntry);
   }
 
+  @Override
   public void checkSupportsRegionDestroy() throws UnsupportedOperationInTransactionException {
     throw new UnsupportedOperationInTransactionException(
         LocalizedStrings.TXState_REGION_DESTROY_NOT_SUPPORTED_IN_A_TRANSACTION.toLocalizedString());
   }
 
+  @Override
   public void checkSupportsRegionInvalidate() throws UnsupportedOperationInTransactionException {
     throw new UnsupportedOperationInTransactionException(
         LocalizedStrings.TXState_REGION_INVALIDATE_NOT_SUPPORTED_IN_A_TRANSACTION
@@ -646,6 +703,7 @@ public class TXStateProxyImpl implements TXStateProxy {
         LocalizedStrings.TXState_REGION_CLEAR_NOT_SUPPORTED_IN_A_TRANSACTION.toLocalizedString());
   }
 
+  @Override
   public Set getBucketKeys(LocalRegion localRegion, int bucketId, boolean allowTombstones) {
     boolean resetTxState = isTransactionInternalSuspendNeeded(localRegion);
     TXStateProxy txp = null;
@@ -664,6 +722,7 @@ public class TXStateProxyImpl implements TXStateProxy {
     }
   }
 
+  @Override
   public Entry getEntryOnRemote(KeyInfo keyInfo, LocalRegion localRegion, boolean allowTombstones)
       throws DataLocationException {
     this.operationCount++;
@@ -676,15 +735,18 @@ public class TXStateProxyImpl implements TXStateProxy {
     getRealDeal(null, null);
   }
 
+  @Override
   public DistributedMember getTarget() {
     return this.target;
   }
 
+  @Override
   public void setTarget(DistributedMember target) {
     assert this.target == null;
     getRealDeal(target);
   }
 
+  @Override
   public Collection<?> getRegionKeysForIteration(LocalRegion currRegion) {
     if (currRegion.isUsedForPartitionedRegionBucket()) {
       return currRegion.getRegionKeysForIteration();
@@ -707,14 +769,17 @@ public class TXStateProxyImpl implements TXStateProxy {
     }
   }
 
+  @Override
   public boolean isCommitOnBehalfOfRemoteStub() {
     return this.commitRequestedByOwner;
   }
 
+  @Override
   public boolean setCommitOnBehalfOfRemoteStub(boolean requestedByOwner) {
     return this.commitRequestedByOwner = requestedByOwner;
   }
 
+  @Override
   public boolean isRealDealLocal() {
     if (this.realDeal != null) {
       return this.realDeal.isRealDealLocal();
@@ -747,6 +812,7 @@ public class TXStateProxyImpl implements TXStateProxy {
     return builder.toString();
   }
 
+  @Override
   public InternalDistributedMember getOriginatingMember() {
     if (this.realDeal == null) {
       return null;
@@ -755,6 +821,7 @@ public class TXStateProxyImpl implements TXStateProxy {
     }
   }
 
+  @Override
   public boolean isMemberIdForwardingRequired() {
     if (this.realDeal == null) {
       return false;
@@ -763,6 +830,7 @@ public class TXStateProxyImpl implements TXStateProxy {
     }
   }
 
+  @Override
   public TXCommitMessage getCommitMessage() {
     if (this.realDeal == null) {
       return null;
@@ -771,6 +839,7 @@ public class TXStateProxyImpl implements TXStateProxy {
     }
   }
 
+  @Override
   public void postPutAll(DistributedPutAllOperation putallOp, VersionedObjectList successfulPuts,
       LocalRegion region) {
     if (putallOp.putAllData.length == 0) {
@@ -802,15 +871,18 @@ public class TXStateProxyImpl implements TXStateProxy {
     tsi.postRemoveAll(op, successfulOps, region);
   }
 
+  @Override
   public boolean isJCATransaction() {
     return this.isJCATransaction;
   }
 
 
+  @Override
   public void setJCATransaction() {
     this.isJCATransaction = true;
   }
 
+  @Override
   public Entry accessEntry(KeyInfo keyInfo, LocalRegion region) {
     try {
       this.operationCount++;
@@ -822,12 +894,14 @@ public class TXStateProxyImpl implements TXStateProxy {
     }
   }
 
+  @Override
   public void suspend() {
     if (this.realDeal != null) {
       getRealDeal(null, null).suspend();
     }
   }
 
+  @Override
   public void resume() {
     if (this.realDeal != null) {
       getRealDeal(null, null).resume();
@@ -835,6 +909,7 @@ public class TXStateProxyImpl implements TXStateProxy {
   }
 
   /** test hook - record a list of ops in the transaction */
+  @Override
   public void recordTXOperation(ServerRegionDataAccess region, ServerRegionOperation op, Object key,
       Object arguments[]) {
     if (ClientTXStateStub.transactionRecordingEnabled()) {
@@ -860,6 +935,7 @@ public class TXStateProxyImpl implements TXStateProxy {
     // Do nothing. Not applicable for transactions.
   }
 
+  @Override
   public void close() {
     if (this.realDeal != null) {
       this.realDeal.close();
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/TXStateStub.java b/geode-core/src/main/java/org/apache/geode/internal/cache/TXStateStub.java
index 899cd67..91a9a58 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/TXStateStub.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/TXStateStub.java
@@ -21,7 +21,6 @@ import java.util.Map;
 import java.util.Set;
 import java.util.concurrent.locks.ReentrantLock;
 
-import org.apache.geode.cache.Cache;
 import org.apache.geode.cache.CommitConflictException;
 import org.apache.geode.cache.EntryNotFoundException;
 import org.apache.geode.cache.Region;
@@ -39,7 +38,6 @@ import org.apache.geode.internal.cache.tier.sockets.ClientProxyMembershipID;
 import org.apache.geode.internal.cache.tier.sockets.VersionedObjectList;
 import org.apache.geode.internal.cache.tx.TXRegionStub;
 import org.apache.geode.internal.i18n.LocalizedStrings;
-import org.apache.geode.internal.logging.LogService;
 
 /**
  * TXStateStub lives on the accessor node when we are remoting a transaction. It is a stub for
@@ -72,6 +70,7 @@ public abstract class TXStateStub implements TXStateInterface {
   /**
    * Implemented in subclasses for Peer vs. Client
    */
+  @Override
   public abstract void commit() throws CommitConflictException;
 
   protected abstract void validateRegionCanJoinTransaction(LocalRegion region)
@@ -79,10 +78,13 @@ public abstract class TXStateStub implements TXStateInterface {
 
   protected abstract TXRegionStub generateRegionStub(LocalRegion region);
 
+  @Override
   public abstract void rollback();
 
+  @Override
   public abstract void afterCompletion(int status);
 
+  @Override
   public void beforeCompletion() {
     // note that this class must do distribution as it is used as the stub class in some situations
     ReliableReplyProcessor21 response = JtaBeforeCompletionMessage.send(proxy.getCache(),
@@ -145,6 +147,7 @@ public abstract class TXStateStub implements TXStateInterface {
    * org.apache.geode.internal.cache.TXStateInterface#destroyExistingEntry(org.apache.geode.internal
    * .cache.EntryEventImpl, boolean, java.lang.Object)
    */
+  @Override
   public void destroyExistingEntry(EntryEventImpl event, boolean cacheWrite,
       Object expectedOldValue) throws EntryNotFoundException {
     if (event.getOperation().isLocal()) {
@@ -161,6 +164,7 @@ public abstract class TXStateStub implements TXStateInterface {
    *
    * @see org.apache.geode.internal.cache.TXStateInterface#getBeginTime()
    */
+  @Override
   public long getBeginTime() {
     // TODO Auto-generated method stub
     return 0;
@@ -171,8 +175,9 @@ public abstract class TXStateStub implements TXStateInterface {
    *
    * @see org.apache.geode.internal.cache.TXStateInterface#getCache()
    */
-  public Cache getCache() {
-    return this.proxy.getTxMgr().getCache();
+  @Override
+  public InternalCache getCache() {
+    return this.proxy.getCache();
   }
 
   /*
@@ -180,6 +185,7 @@ public abstract class TXStateStub implements TXStateInterface {
    *
    * @see org.apache.geode.internal.cache.TXStateInterface#getChanges()
    */
+  @Override
   public int getChanges() {
     // TODO Auto-generated method stub
     return 0;
@@ -191,6 +197,7 @@ public abstract class TXStateStub implements TXStateInterface {
    * @see org.apache.geode.internal.cache.TXStateInterface#getDeserializedValue(java.lang.Object,
    * org.apache.geode.internal.cache.LocalRegion, boolean)
    */
+  @Override
   public Object getDeserializedValue(KeyInfo keyInfo, LocalRegion localRegion, boolean updateStats,
       boolean disableCopyOnRead, boolean preferCD, EntryEventImpl clientEvent,
       boolean returnTombstones, boolean retainResult) {
@@ -211,6 +218,7 @@ public abstract class TXStateStub implements TXStateInterface {
    * @see org.apache.geode.internal.cache.TXStateInterface#getEntry(java.lang.Object,
    * org.apache.geode.internal.cache.LocalRegion)
    */
+  @Override
   public Entry getEntry(KeyInfo keyInfo, LocalRegion r, boolean allowTombstones) {
     return getTXRegionStub(r).getEntry(keyInfo, allowTombstones);
     // Entry retVal = null;
@@ -226,6 +234,7 @@ public abstract class TXStateStub implements TXStateInterface {
    *
    * @see org.apache.geode.internal.cache.TXStateInterface#getEvent()
    */
+  @Override
   public TXEvent getEvent() {
     throw new UnsupportedOperationException();
   }
@@ -235,6 +244,7 @@ public abstract class TXStateStub implements TXStateInterface {
    *
    * @see org.apache.geode.internal.cache.TXStateInterface#getEvents()
    */
+  @Override
   public List getEvents() {
     throw new UnsupportedOperationException();
   }
@@ -244,6 +254,7 @@ public abstract class TXStateStub implements TXStateInterface {
    *
    * @see org.apache.geode.internal.cache.TXStateInterface#getRegions()
    */
+  @Override
   public Collection<LocalRegion> getRegions() {
     throw new UnsupportedOperationException();
   }
@@ -253,6 +264,7 @@ public abstract class TXStateStub implements TXStateInterface {
    *
    * @see org.apache.geode.internal.cache.TXStateInterface#getTransactionId()
    */
+  @Override
   public TransactionId getTransactionId() {
     return this.proxy.getTxId();
   }
@@ -263,6 +275,7 @@ public abstract class TXStateStub implements TXStateInterface {
    * @see org.apache.geode.internal.cache.TXStateInterface#invalidateExistingEntry(org.apache.geode.
    * internal.cache.EntryEventImpl, boolean, boolean)
    */
+  @Override
   public void invalidateExistingEntry(EntryEventImpl event, boolean invokeCallbacks,
       boolean forceNewEntry) {
     if (event.getOperation().isLocal()) {
@@ -280,6 +293,7 @@ public abstract class TXStateStub implements TXStateInterface {
    *
    * @see org.apache.geode.internal.cache.TXStateInterface#isInProgress()
    */
+  @Override
   public boolean isInProgress() {
     return this.proxy.isInProgress();
   }
@@ -290,6 +304,7 @@ public abstract class TXStateStub implements TXStateInterface {
    * @see org.apache.geode.internal.cache.TXStateInterface#isInProgressAndSameAs(org.apache.geode.
    * internal.cache.TXStateInterface)
    */
+  @Override
   public boolean isInProgressAndSameAs(TXStateInterface state) {
     throw new UnsupportedOperationException();
   }
@@ -299,6 +314,7 @@ public abstract class TXStateStub implements TXStateInterface {
    *
    * @see org.apache.geode.internal.cache.TXStateInterface#needsLargeModCount()
    */
+  @Override
   public boolean needsLargeModCount() {
     // TODO Auto-generated method stub
     return false;
@@ -309,6 +325,7 @@ public abstract class TXStateStub implements TXStateInterface {
    *
    * @see org.apache.geode.internal.cache.TXStateInterface#nextModSerialNum()
    */
+  @Override
   public int nextModSerialNum() {
     // TODO Auto-generated method stub
     return 0;
@@ -321,6 +338,7 @@ public abstract class TXStateStub implements TXStateInterface {
    * org.apache.geode.internal.cache.TXStateInterface#readRegion(org.apache.geode.internal.cache.
    * LocalRegion)
    */
+  @Override
   public TXRegionState readRegion(LocalRegion r) {
     throw new UnsupportedOperationException();
   }
@@ -331,6 +349,7 @@ public abstract class TXStateStub implements TXStateInterface {
    * @see org.apache.geode.internal.cache.TXStateInterface#rmRegion(org.apache.geode.internal.cache.
    * LocalRegion)
    */
+  @Override
   public void rmRegion(LocalRegion r) {
     throw new UnsupportedOperationException();
   }
@@ -355,6 +374,7 @@ public abstract class TXStateStub implements TXStateInterface {
    * org.apache.geode.internal.cache.TXStateInterface#txPutEntry(org.apache.geode.internal.cache.
    * EntryEventImpl, boolean, boolean, boolean)
    */
+  @Override
   public boolean txPutEntry(EntryEventImpl event, boolean ifNew, boolean requireOldValue,
       boolean checkResources, Object expectedOldValue) {
     return false;
@@ -366,6 +386,7 @@ public abstract class TXStateStub implements TXStateInterface {
    * @see org.apache.geode.internal.cache.TXStateInterface#txReadEntry(java.lang.Object,
    * org.apache.geode.internal.cache.LocalRegion, boolean)
    */
+  @Override
   public TXEntryState txReadEntry(KeyInfo entryKey, LocalRegion localRegion, boolean rememberRead,
       boolean createTxEntryIfAbsent) {
     // TODO Auto-generated method stub
@@ -379,6 +400,7 @@ public abstract class TXStateStub implements TXStateInterface {
    * org.apache.geode.internal.cache.TXStateInterface#txReadRegion(org.apache.geode.internal.cache.
    * LocalRegion)
    */
+  @Override
   public TXRegionState txReadRegion(LocalRegion localRegion) {
     // TODO Auto-generated method stub
     return null;
@@ -391,6 +413,7 @@ public abstract class TXStateStub implements TXStateInterface {
    * org.apache.geode.internal.cache.TXStateInterface#txWriteRegion(org.apache.geode.internal.cache.
    * LocalRegion, java.lang.Object)
    */
+  @Override
   public TXRegionState txWriteRegion(LocalRegion localRegion, KeyInfo entryKey) {
     // TODO Auto-generated method stub
     return null;
@@ -403,6 +426,7 @@ public abstract class TXStateStub implements TXStateInterface {
    * org.apache.geode.internal.cache.TXStateInterface#writeRegion(org.apache.geode.internal.cache.
    * LocalRegion)
    */
+  @Override
   public TXRegionState writeRegion(LocalRegion r) {
     // TODO Auto-generated method stub
     return null;
@@ -414,6 +438,7 @@ public abstract class TXStateStub implements TXStateInterface {
    * @see org.apache.geode.internal.cache.InternalDataView#containsKey(java.lang.Object,
    * org.apache.geode.internal.cache.LocalRegion)
    */
+  @Override
   public boolean containsKey(KeyInfo keyInfo, LocalRegion localRegion) {
     return getTXRegionStub(localRegion).containsKey(keyInfo);
   }
@@ -424,6 +449,7 @@ public abstract class TXStateStub implements TXStateInterface {
    * @see org.apache.geode.internal.cache.InternalDataView#containsValueForKey(java.lang.Object,
    * org.apache.geode.internal.cache.LocalRegion)
    */
+  @Override
   public boolean containsValueForKey(KeyInfo keyInfo, LocalRegion localRegion) {
     return getTXRegionStub(localRegion).containsValueForKey(keyInfo);
   }
@@ -435,6 +461,7 @@ public abstract class TXStateStub implements TXStateInterface {
    * org.apache.geode.internal.cache.InternalDataView#entryCount(org.apache.geode.internal.cache.
    * LocalRegion)
    */
+  @Override
   public int entryCount(LocalRegion localRegion) {
     return getTXRegionStub(localRegion).entryCount();
   }
@@ -446,6 +473,7 @@ public abstract class TXStateStub implements TXStateInterface {
    * org.apache.geode.internal.cache.InternalDataView#findObject(org.apache.geode.internal.cache.
    * LocalRegion, java.lang.Object, java.lang.Object, boolean, boolean, java.lang.Object)
    */
+  @Override
   public Object findObject(KeyInfo keyInfo, LocalRegion r, boolean isCreate,
       boolean generateCallbacks, Object value, boolean disableCopyOnRead, boolean preferCD,
       ClientProxyMembershipID requestingClient, EntryEventImpl clientEvent,
@@ -461,6 +489,7 @@ public abstract class TXStateStub implements TXStateInterface {
    * org.apache.geode.internal.cache.InternalDataView#getAdditionalKeysForIterator(org.apache.geode.
    * internal.cache.LocalRegion)
    */
+  @Override
   public Set getAdditionalKeysForIterator(LocalRegion currRgn) {
     // TODO Auto-generated method stub
     return null;
@@ -473,6 +502,7 @@ public abstract class TXStateStub implements TXStateInterface {
    * org.apache.geode.internal.cache.InternalDataView#getEntryForIterator(org.apache.geode.internal.
    * cache.LocalRegion, java.lang.Object, boolean)
    */
+  @Override
   public Object getEntryForIterator(KeyInfo keyInfo, LocalRegion currRgn, boolean rememberReads,
       boolean allowTombstones) {
     return getTXRegionStub(currRgn).getEntryForIterator(keyInfo, allowTombstones);
@@ -484,6 +514,7 @@ public abstract class TXStateStub implements TXStateInterface {
    * @see org.apache.geode.internal.cache.InternalDataView#getKeyForIterator(java.lang.Object,
    * org.apache.geode.internal.cache.LocalRegion, boolean)
    */
+  @Override
   public Object getKeyForIterator(KeyInfo keyInfo, LocalRegion currRgn, boolean rememberReads,
       boolean allowTombstones) {
     Object key = keyInfo.getKey();
@@ -499,6 +530,7 @@ public abstract class TXStateStub implements TXStateInterface {
    * @see org.apache.geode.internal.cache.InternalDataView#getValueInVM(java.lang.Object,
    * org.apache.geode.internal.cache.LocalRegion, boolean)
    */
+  @Override
   public Object getValueInVM(KeyInfo keyInfo, LocalRegion localRegion, boolean rememberRead) {
     // TODO Auto-generated method stub
     return null;
@@ -509,6 +541,7 @@ public abstract class TXStateStub implements TXStateInterface {
    *
    * @see org.apache.geode.internal.cache.InternalDataView#isDeferredStats()
    */
+  @Override
   public boolean isDeferredStats() {
     return true;
   }
@@ -519,6 +552,7 @@ public abstract class TXStateStub implements TXStateInterface {
    * @see org.apache.geode.internal.cache.InternalDataView#putEntry(org.apache.geode.internal.cache.
    * EntryEventImpl, boolean, boolean, java.lang.Object, boolean, long, boolean)
    */
+  @Override
   public boolean putEntry(EntryEventImpl event, boolean ifNew, boolean ifOld,
       Object expectedOldValue, boolean requireOldValue, long lastModified,
       boolean overwriteDestroyed) {
@@ -533,6 +567,7 @@ public abstract class TXStateStub implements TXStateInterface {
    * org.apache.geode.internal.cache.InternalDataView#getSerializedValue(org.apache.geode.internal.
    * cache.LocalRegion, java.lang.Object, java.lang.Object)
    */
+  @Override
   public Object getSerializedValue(LocalRegion localRegion, KeyInfo key, boolean doNotLockEntry,
       ClientProxyMembershipID requestingClient, EntryEventImpl clientEvent,
       boolean returnTombstones) {
@@ -546,12 +581,14 @@ public abstract class TXStateStub implements TXStateInterface {
    * org.apache.geode.internal.cache.InternalDataView#putEntryOnRemote(org.apache.geode.internal.
    * cache.EntryEventImpl, boolean, boolean, java.lang.Object, boolean, long, boolean)
    */
+  @Override
   public boolean putEntryOnRemote(EntryEventImpl event, boolean ifNew, boolean ifOld,
       Object expectedOldValue, boolean requireOldValue, long lastModified,
       boolean overwriteDestroyed) throws DataLocationException {
     throw new IllegalStateException();
   }
 
+  @Override
   public boolean isFireCallbacks() {
     return false;
   }
@@ -562,6 +599,7 @@ public abstract class TXStateStub implements TXStateInterface {
    * @see org.apache.geode.internal.cache.InternalDataView#destroyOnRemote(java.lang.Integer,
    * org.apache.geode.internal.cache.EntryEventImpl, java.lang.Object)
    */
+  @Override
   public void destroyOnRemote(EntryEventImpl event, boolean cacheWrite, Object expectedOldValue)
       throws DataLocationException {
     throw new IllegalStateException();
@@ -574,16 +612,19 @@ public abstract class TXStateStub implements TXStateInterface {
    * org.apache.geode.internal.cache.InternalDataView#invalidateOnRemote(org.apache.geode.internal.
    * cache.EntryEventImpl, boolean, boolean)
    */
+  @Override
   public void invalidateOnRemote(EntryEventImpl event, boolean invokeCallbacks,
       boolean forceNewEntry) throws DataLocationException {
     throw new IllegalStateException();
   }
 
+  @Override
   public void checkSupportsRegionDestroy() throws UnsupportedOperationInTransactionException {
     throw new UnsupportedOperationInTransactionException(
         LocalizedStrings.TXState_REGION_DESTROY_NOT_SUPPORTED_IN_A_TRANSACTION.toLocalizedString());
   }
 
+  @Override
   public void checkSupportsRegionInvalidate() throws UnsupportedOperationInTransactionException {
     throw new UnsupportedOperationInTransactionException(
         LocalizedStrings.TXState_REGION_INVALIDATE_NOT_SUPPORTED_IN_A_TRANSACTION
@@ -603,6 +644,7 @@ public abstract class TXStateStub implements TXStateInterface {
    * org.apache.geode.internal.cache.InternalDataView#getBucketKeys(org.apache.geode.internal.cache.
    * LocalRegion, int)
    */
+  @Override
   public Set getBucketKeys(LocalRegion localRegion, int bucketId, boolean allowTombstones) {
     PartitionedRegion pr = (PartitionedRegion) localRegion;
     /*
@@ -617,6 +659,7 @@ public abstract class TXStateStub implements TXStateInterface {
    * @see org.apache.geode.internal.cache.InternalDataView#getEntryOnRemote(java.lang.Object,
    * org.apache.geode.internal.cache.LocalRegion)
    */
+  @Override
   public Entry getEntryOnRemote(KeyInfo key, LocalRegion localRegion, boolean allowTombstones)
       throws DataLocationException {
     throw new IllegalStateException();
@@ -627,6 +670,7 @@ public abstract class TXStateStub implements TXStateInterface {
    *
    * @see org.apache.geode.internal.cache.TXStateInterface#getSemaphore()
    */
+  @Override
   public ReentrantLock getLock() {
     return proxy.getLock();
   }
@@ -638,11 +682,13 @@ public abstract class TXStateStub implements TXStateInterface {
    * org.apache.geode.internal.cache.InternalDataView#getRegionKeysForIteration(org.apache.geode.
    * internal.cache.LocalRegion)
    */
+  @Override
   public Set getRegionKeysForIteration(LocalRegion currRegion) {
     return getTXRegionStub(currRegion).getRegionKeysForIteration(currRegion);
   }
 
 
+  @Override
   public boolean isRealDealLocal() {
     return false;
   }
@@ -651,6 +697,7 @@ public abstract class TXStateStub implements TXStateInterface {
     return target;
   }
 
+  @Override
   public void postPutAll(DistributedPutAllOperation putallOp, VersionedObjectList successfulPuts,
       LocalRegion region) {
     getTXRegionStub(region).postPutAll(putallOp, successfulPuts, region);
@@ -663,6 +710,7 @@ public abstract class TXStateStub implements TXStateInterface {
   }
 
 
+  @Override
   public Entry accessEntry(KeyInfo keyInfo, LocalRegion localRegion) {
     return getEntry(keyInfo, localRegion, false);
   }
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/TXSynchronizationRunnable.java b/geode-core/src/main/java/org/apache/geode/internal/cache/TXSynchronizationRunnable.java
index 63e831d..4603d93 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/TXSynchronizationRunnable.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/TXSynchronizationRunnable.java
@@ -16,6 +16,7 @@ package org.apache.geode.internal.cache;
 
 import org.apache.logging.log4j.Logger;
 
+import org.apache.geode.CancelCriterion;
 import org.apache.geode.internal.cache.tier.sockets.CommBufferPool;
 import org.apache.geode.internal.logging.LogService;
 
@@ -30,6 +31,9 @@ import org.apache.geode.internal.logging.LogService;
 public class TXSynchronizationRunnable implements Runnable {
   private static final Logger logger = LogService.getLogger();
 
+  private final CancelCriterion cancelCriterion;
+  private final CommBufferPool commBufferPool;
+
   private Runnable firstRunnable;
   private final Object firstRunnableSync = new Object();
   private boolean firstRunnableCompleted;
@@ -39,13 +43,15 @@ public class TXSynchronizationRunnable implements Runnable {
   private boolean secondRunnableCompleted;
 
   private boolean abort;
-  private final CommBufferPool commBufferPool;
 
-  public TXSynchronizationRunnable(Runnable beforeCompletion, final CommBufferPool commBufferPool) {
-    this.firstRunnable = beforeCompletion;
+  public TXSynchronizationRunnable(final CancelCriterion cancelCriterion,
+      final CommBufferPool commBufferPool, final Runnable beforeCompletion) {
+    this.cancelCriterion = cancelCriterion;
     this.commBufferPool = commBufferPool;
+    this.firstRunnable = beforeCompletion;
   }
 
+  @Override
   public void run() {
     commBufferPool.setTLCommBuffer();
     try {
@@ -70,7 +76,7 @@ public class TXSynchronizationRunnable implements Runnable {
     }
     synchronized (this.secondRunnableSync) {
       // TODO there should be a transaction timeout that keeps this thread
-      // from sitting around forever in the event the client goes away
+      // from sitting around forever if the client goes away
       final boolean isTraceEnabled = logger.isTraceEnabled();
       while (this.secondRunnable == null && !this.abort) {
         try {
@@ -81,12 +87,6 @@ public class TXSynchronizationRunnable implements Runnable {
         } catch (InterruptedException ignore) {
           // eat the interrupt and check for exit conditions
         }
-        if (this.secondRunnable == null) {
-          InternalCache cache = GemFireCacheImpl.getInstance();
-          if (cache == null || cache.getCancelCriterion().isCancelInProgress()) {
-            return;
-          }
-        }
       }
       if (isTraceEnabled) {
         logger.trace("executing afterCompletion notification");
@@ -117,13 +117,7 @@ public class TXSynchronizationRunnable implements Runnable {
         } catch (InterruptedException ignore) {
           // eat the interrupt and check for exit conditions
         }
-        // we really need the Cache Server's cancel criterion here, not the cache's
-        // but who knows how to get it?
-        InternalCache cache = GemFireCacheImpl.getInstance();
-        if (cache == null) {
-          return;
-        }
-        cache.getCancelCriterion().checkCancelInProgress(null);
+        cancelCriterion.checkCancelInProgress(null);
       }
     }
   }
@@ -142,13 +136,7 @@ public class TXSynchronizationRunnable implements Runnable {
         } catch (InterruptedException ignore) {
           // eat the interrupt and check for exit conditions
         }
-        // we really need the Cache Server's cancel criterion here, not the cache's
-        // but who knows how to get it?
-        InternalCache cache = GemFireCacheImpl.getInstance();
-        if (cache == null) {
-          return;
-        }
-        cache.getCancelCriterion().checkCancelInProgress(null);
+        cancelCriterion.checkCancelInProgress(null);
       }
     }
   }
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/entries/AbstractRegionEntry.java b/geode-core/src/main/java/org/apache/geode/internal/cache/entries/AbstractRegionEntry.java
index 59ba989..59afe78 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/entries/AbstractRegionEntry.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/entries/AbstractRegionEntry.java
@@ -460,7 +460,7 @@ public abstract class AbstractRegionEntry implements RegionEntry, HashEntry<Obje
       ReferenceCountHelper.setReferenceCountOwner(null);
       return null;
     } else {
-      result = OffHeapHelper.copyAndReleaseIfNeeded(result);
+      result = OffHeapHelper.copyAndReleaseIfNeeded(result, context.getCache());
       ReferenceCountHelper.setReferenceCountOwner(null);
       setRecentlyUsed(context);
       return result;
@@ -564,8 +564,8 @@ public abstract class AbstractRegionEntry implements RegionEntry, HashEntry<Obje
           if (!(cd.getValue() instanceof byte[])) {
             // The cd now has the object form so use the cached serialized form in a new cd.
             // This serialization is much cheaper than reserializing the object form.
-            serializedValue =
-                EntryEventImpl.serialize(CachedDeserializableFactory.create(serializedValue));
+            serializedValue = EntryEventImpl
+                .serialize(CachedDeserializableFactory.create(serializedValue, context.getCache()));
           } else {
             serializedValue = EntryEventImpl.serialize(cd);
           }
@@ -617,7 +617,7 @@ public abstract class AbstractRegionEntry implements RegionEntry, HashEntry<Obje
       // should only be possible if disk entry
       v = Token.NOT_AVAILABLE;
     }
-    Object result = OffHeapHelper.copyAndReleaseIfNeeded(v);
+    Object result = OffHeapHelper.copyAndReleaseIfNeeded(v, context.getCache());
     ReferenceCountHelper.setReferenceCountOwner(null);
     return result;
   }
@@ -1341,7 +1341,7 @@ public abstract class AbstractRegionEntry implements RegionEntry, HashEntry<Obje
           byte[] valAsBytes = soVal.getValueAsHeapByteArray();
           Object heapValue;
           if (soVal.isSerialized()) {
-            heapValue = CachedDeserializableFactory.create(valAsBytes);
+            heapValue = CachedDeserializableFactory.create(valAsBytes, r.getCache());
           } else {
             heapValue = valAsBytes;
           }
@@ -1394,7 +1394,7 @@ public abstract class AbstractRegionEntry implements RegionEntry, HashEntry<Obje
     if (nv instanceof StoredObject) {
       // This off heap value is being put into a on heap region.
       byte[] data = ((StoredObject) nv).getSerializedValue();
-      nv = CachedDeserializableFactory.create(data);
+      nv = CachedDeserializableFactory.create(data, r.getCache());
     }
     if (nv instanceof PdxInstanceImpl) {
       // We do not want to put PDXs in the cache as values.
@@ -1404,7 +1404,7 @@ public abstract class AbstractRegionEntry implements RegionEntry, HashEntry<Obje
         byte[] compressedData = compressBytes(r, data);
         // TODO: array comparison is broken
         if (data == compressedData) {
-          nv = CachedDeserializableFactory.create(data);
+          nv = CachedDeserializableFactory.create(data, r.getCache());
         } else {
           nv = compressedData;
         }
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/entries/DiskEntry.java b/geode-core/src/main/java/org/apache/geode/internal/cache/entries/DiskEntry.java
index 98bc14b..fee0162 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/entries/DiskEntry.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/entries/DiskEntry.java
@@ -38,6 +38,7 @@ import org.apache.geode.internal.cache.DistributedRegion;
 import org.apache.geode.internal.cache.EntryBits;
 import org.apache.geode.internal.cache.EntryEventImpl;
 import org.apache.geode.internal.cache.InitialImageOperation;
+import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.internal.cache.InternalRegion;
 import org.apache.geode.internal.cache.PlaceHolderDiskRegion;
 import org.apache.geode.internal.cache.RegionClearedException;
@@ -1001,8 +1002,8 @@ public interface DiskEntry extends RegionEntry {
     }
 
     public static Object getValueInVMOrDiskWithoutFaultIn(DiskEntry entry, InternalRegion region) {
-      Object result =
-          OffHeapHelper.copyAndReleaseIfNeeded(getValueOffHeapOrDiskWithoutFaultIn(entry, region));
+      Object result = OffHeapHelper.copyAndReleaseIfNeeded(
+          getValueOffHeapOrDiskWithoutFaultIn(entry, region), region.getCache());
       if (result instanceof CachedDeserializable) {
         result = ((CachedDeserializable) result).getDeserializedValue(null, null);
       }
@@ -1092,7 +1093,7 @@ public interface DiskEntry extends RegionEntry {
         }
       } finally {
         if (!retainResult) {
-          v = OffHeapHelper.copyAndReleaseIfNeeded(v);
+          v = OffHeapHelper.copyAndReleaseIfNeeded(v, region.getCache());
           // At this point v should be either a heap object
         }
       }
@@ -1122,7 +1123,7 @@ public interface DiskEntry extends RegionEntry {
               synchronized (did) {
                 // don't read if the oplog has changed.
                 if (oplogId == did.getOplogId()) {
-                  value = getValueFromDisk(dr, did, in);
+                  value = getValueFromDisk(dr, did, in, dr.getCache());
                   if (value != null) {
                     setValueOnFaultIn(value, did, entry, dr, recoveryStore);
                   }
@@ -1148,7 +1149,8 @@ public interface DiskEntry extends RegionEntry {
     /**
      * Caller must have "did" synced.
      */
-    private static Object getValueFromDisk(DiskRegionView dr, DiskId did, ByteArrayDataInput in) {
+    private static Object getValueFromDisk(DiskRegionView dr, DiskId did, ByteArrayDataInput in,
+        InternalCache cache) {
       Object value;
       if (dr.isBackup() && did.getKeyId() == DiskRegion.INVALID_ID) {
         // must have been destroyed
@@ -1165,7 +1167,7 @@ public interface DiskEntry extends RegionEntry {
           } else if (EntryBits.isTombstone(bb.getBits())) {
             value = Token.TOMBSTONE;
           } else if (EntryBits.isSerialized(bb.getBits())) {
-            value = readSerializedValue(bb.getBytes(), bb.getVersion(), in, false);
+            value = readSerializedValue(bb.getBytes(), bb.getVersion(), in, false, cache);
           } else {
             value = readRawValue(bb.getBytes(), bb.getVersion(), in);
           }
@@ -1219,7 +1221,7 @@ public interface DiskEntry extends RegionEntry {
       dr.acquireReadLock();
       try {
         synchronized (did) {
-          Object value = getValueFromDisk(dr, did, null);
+          Object value = getValueFromDisk(dr, did, null, dr.getCache());
           if (value == null)
             return null;
           setValueOnFaultIn(value, did, entry, dr, region);
@@ -1261,7 +1263,7 @@ public interface DiskEntry extends RegionEntry {
     }
 
     public static Object readSerializedValue(byte[] valueBytes, Version version,
-        ByteArrayDataInput in, boolean forceDeserialize) {
+        ByteArrayDataInput in, boolean forceDeserialize, InternalCache cache) {
       if (forceDeserialize) {
         // deserialize checking for product version change
         return EntryEventImpl.deserialize(valueBytes, version, in);
@@ -1269,7 +1271,7 @@ public interface DiskEntry extends RegionEntry {
         // TODO: upgrades: is there a case where GemFire values are internal
         // ones that need to be upgraded transparently; probably messages
         // being persisted (gateway events?)
-        return CachedDeserializableFactory.create(valueBytes);
+        return CachedDeserializableFactory.create(valueBytes, cache);
       }
     }
 
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/execute/ServerFunctionExecutor.java b/geode-core/src/main/java/org/apache/geode/internal/cache/execute/ServerFunctionExecutor.java
index c56fa2b..d3c47a7 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/execute/ServerFunctionExecutor.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/execute/ServerFunctionExecutor.java
@@ -90,7 +90,7 @@ public class ServerFunctionExecutor extends AbstractExecution {
     try {
       if (proxyCache != null) {
         if (this.proxyCache.isClosed()) {
-          throw new CacheClosedException("Cache is closed for this user.");
+          throw proxyCache.getCacheClosedException("Cache is closed for this user.");
         }
         UserAttributes.userAttributes.set(this.proxyCache.getUserAttributes());
       }
@@ -119,7 +119,7 @@ public class ServerFunctionExecutor extends AbstractExecution {
     try {
       if (proxyCache != null) {
         if (this.proxyCache.isClosed()) {
-          throw new CacheClosedException("Cache is closed for this user.");
+          throw proxyCache.getCacheClosedException("Cache is closed for this user.");
         }
         UserAttributes.userAttributes.set(this.proxyCache.getUserAttributes());
       }
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/execute/ServerRegionFunctionExecutor.java b/geode-core/src/main/java/org/apache/geode/internal/cache/execute/ServerRegionFunctionExecutor.java
index 1282e44..e15d34b 100755
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/execute/ServerRegionFunctionExecutor.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/execute/ServerRegionFunctionExecutor.java
@@ -148,7 +148,7 @@ public class ServerRegionFunctionExecutor extends AbstractExecution {
     try {
       if (proxyCache != null) {
         if (this.proxyCache.isClosed()) {
-          throw new CacheClosedException("Cache is closed for this user.");
+          throw proxyCache.getCacheClosedException("Cache is closed for this user.");
         }
         UserAttributes.userAttributes.set(this.proxyCache.getUserAttributes());
       }
@@ -175,7 +175,7 @@ public class ServerRegionFunctionExecutor extends AbstractExecution {
     try {
       if (proxyCache != null) {
         if (this.proxyCache.isClosed()) {
-          throw new CacheClosedException("Cache is closed for this user.");
+          throw proxyCache.getCacheClosedException("Cache is closed for this user.");
         }
         UserAttributes.userAttributes.set(this.proxyCache.getUserAttributes());
       }
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/GetMessage.java b/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/GetMessage.java
index fba07d8..af8e1d8 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/GetMessage.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/GetMessage.java
@@ -538,7 +538,8 @@ public class GetMessage extends PartitionMessageWithDirectReply {
             default:
               if (reply.valueInBytes != null) {
                 if (preferCD) {
-                  return CachedDeserializableFactory.create(reply.valueInBytes);
+                  return CachedDeserializableFactory.create(reply.valueInBytes,
+                      getDistributionManager().getCache());
                 } else {
                   return BlobHelper.deserializeBlob(reply.valueInBytes, reply.remoteVersion, null);
                 }
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/PartitionMessage.java b/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/PartitionMessage.java
index 703a409..d2c2cd7 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/PartitionMessage.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/PartitionMessage.java
@@ -302,9 +302,16 @@ public abstract class PartitionMessage extends DistributionMessage
     long startTime = 0;
     EntryLogger.setSource(getSender(), "PR");
     try {
+      InternalCache cache = dm.getCache();
       if (checkCacheClosing(dm) || checkDSClosing(dm)) {
-        thr = new CacheClosedException(LocalizedStrings.PartitionMessage_REMOTE_CACHE_IS_CLOSED_0
-            .toLocalizedString(dm.getId()));
+        if (cache != null) {
+          thr = cache
+              .getCacheClosedException(LocalizedStrings.PartitionMessage_REMOTE_CACHE_IS_CLOSED_0
+                  .toLocalizedString(dm.getId()));
+        } else {
+          thr = new CacheClosedException(LocalizedStrings.PartitionMessage_REMOTE_CACHE_IS_CLOSED_0
+              .toLocalizedString(dm.getId()));
+        }
         return;
       }
       pr = getPartitionedRegion();
@@ -322,7 +329,6 @@ public abstract class PartitionMessage extends DistributionMessage
       }
       thr = UNHANDLED_EXCEPTION;
 
-      InternalCache cache = getInternalCache();
       if (cache == null) {
         throw new ForceReattemptException(
             LocalizedStrings.PartitionMessage_REMOTE_CACHE_IS_CLOSED_0.toLocalizedString());
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/snapshot/CacheSnapshotServiceImpl.java b/geode-core/src/main/java/org/apache/geode/internal/cache/snapshot/CacheSnapshotServiceImpl.java
index b3c920c..bb37198 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/snapshot/CacheSnapshotServiceImpl.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/snapshot/CacheSnapshotServiceImpl.java
@@ -101,7 +101,7 @@ public class CacheSnapshotServiceImpl implements CacheSnapshotService {
       SnapshotOptions<Object, Object> options) throws IOException, ClassNotFoundException {
 
     for (File file : snapshotFiles) {
-      GFSnapshotImporter in = new GFSnapshotImporter(file);
+      GFSnapshotImporter in = new GFSnapshotImporter(file, cache.getPdxRegistry());
       try {
         byte version = in.getVersion();
         if (version == GFSnapshot.SNAP_VER_1) {
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/snapshot/ClientExporter.java b/geode-core/src/main/java/org/apache/geode/internal/cache/snapshot/ClientExporter.java
index 482f890..de26fb4 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/snapshot/ClientExporter.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/snapshot/ClientExporter.java
@@ -86,7 +86,7 @@ public class ClientExporter<K, V> implements Exporter<K, V> {
    * @param <K> the key type
    * @param <V> the value type
    */
-  private static class ClientArgs<K, V> implements Serializable {
+  static class ClientArgs<K, V> implements Serializable {
     private static final long serialVersionUID = 1;
 
     private final String region;
@@ -118,7 +118,7 @@ public class ClientExporter<K, V> implements Exporter<K, V> {
    * @param <K> the key type
    * @param <V> the value type
    */
-  private static class ProxyExportFunction<K, V> implements Function {
+  static class ProxyExportFunction<K, V> implements Function {
     private static final long serialVersionUID = 1L;
 
     @Override
@@ -132,8 +132,7 @@ public class ClientExporter<K, V> implements Exporter<K, V> {
       ResultSender rs = context.getResultSender();
       ExportSink sink = new ResultSenderSink(rs);
 
-      Region<K, V> region =
-          GemFireCacheImpl.getExisting("Exporting snapshot").getRegion(args.getRegion());
+      Region<K, V> region = context.getCache().getRegion(args.getRegion());
       Exporter<K, V> exp = args.isPRSingleHop() ? new LocalExporter<K, V>()
           : RegionSnapshotServiceImpl.<K, V>createExporter(region, args.options);
 
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/snapshot/GFSnapshot.java b/geode-core/src/main/java/org/apache/geode/internal/cache/snapshot/GFSnapshot.java
index 9c714a6..587cede 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/snapshot/GFSnapshot.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/snapshot/GFSnapshot.java
@@ -79,7 +79,7 @@ public class GFSnapshot {
       ExitCode.FATAL.doSystemExit();
     }
 
-    GFSnapshotImporter imp = new GFSnapshotImporter(new File(args[0]));
+    GFSnapshotImporter imp = new GFSnapshotImporter(new File(args[0]), null);
     try {
       System.out.println("Snapshot format is version " + imp.getVersion());
       System.out.println("Snapshot region is " + imp.getRegionName());
@@ -141,10 +141,10 @@ public class GFSnapshot {
    * @throws IOException error reading the snapshot file
    * @throws ClassNotFoundException unable to deserialize entry
    */
-  public static <K, V> SnapshotIterator<K, V> read(final File snapshot)
+  public static <K, V> SnapshotIterator<K, V> read(final File snapshot, TypeRegistry typeRegistry)
       throws IOException, ClassNotFoundException {
     return new SnapshotIterator<K, V>() {
-      GFSnapshotImporter in = new GFSnapshotImporter(snapshot);
+      GFSnapshotImporter in = new GFSnapshotImporter(snapshot, typeRegistry);
 
       private boolean foundNext;
       private Entry<K, V> next;
@@ -290,7 +290,8 @@ public class GFSnapshot {
     /** the input stream */
     private final DataInputStream dis;
 
-    public GFSnapshotImporter(File in) throws IOException, ClassNotFoundException {
+    public GFSnapshotImporter(File in, TypeRegistry typeRegistry)
+        throws IOException, ClassNotFoundException {
       pdx = new ExportedRegistry();
 
       // read header and pdx registry
@@ -340,8 +341,8 @@ public class GFSnapshot {
       // check compatibility with the existing pdx types so we don't have to
       // do any translation...preexisting types or concurrent put ops may cause
       // this check to fail
-      checkPdxTypeCompatibility();
-      checkPdxEnumCompatibility();
+      checkPdxTypeCompatibility(typeRegistry);
+      checkPdxEnumCompatibility(typeRegistry);
 
       // open new stream with buffering for reading entries
       dis = new DataInputStream(new BufferedInputStream(new FileInputStream(in)));
@@ -396,16 +397,7 @@ public class GFSnapshot {
       dis.close();
     }
 
-    private TypeRegistry getRegistry() {
-      InternalCache gfc = GemFireCacheImpl.getInstance();
-      if (gfc != null) {
-        return gfc.getPdxRegistry();
-      }
-      return null;
-    }
-
-    private void checkPdxTypeCompatibility() {
-      TypeRegistry tr = getRegistry();
+    private void checkPdxTypeCompatibility(TypeRegistry tr) {
       if (tr == null) {
         return;
       }
@@ -415,8 +407,7 @@ public class GFSnapshot {
       }
     }
 
-    private void checkPdxEnumCompatibility() {
-      TypeRegistry tr = getRegistry();
+    private void checkPdxEnumCompatibility(TypeRegistry tr) {
       if (tr == null) {
         return;
       }
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/snapshot/RegionSnapshotServiceImpl.java b/geode-core/src/main/java/org/apache/geode/internal/cache/snapshot/RegionSnapshotServiceImpl.java
index 9554f21..2406cc8 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/snapshot/RegionSnapshotServiceImpl.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/snapshot/RegionSnapshotServiceImpl.java
@@ -237,7 +237,7 @@ public class RegionSnapshotServiceImpl<K, V> implements RegionSnapshotService<K,
     // Would be interesting to use a PriorityQueue ordered on isDone()
     // but this is probably close enough in practice.
     LinkedList<Future<?>> puts = new LinkedList<>();
-    GFSnapshotImporter in = new GFSnapshotImporter(snapshot);
+    GFSnapshotImporter in = new GFSnapshotImporter(snapshot, local.getCache().getPdxRegistry());
 
     try {
       int bufferSize = 0;
@@ -265,7 +265,7 @@ public class RegionSnapshotServiceImpl<K, V> implements RegionSnapshotService<K,
             // keep the logic in the InternalDataSerializer.
             val = record.getValueObject();
           } else {
-            val = (V) CachedDeserializableFactory.create(record.getValue());
+            val = (V) CachedDeserializableFactory.create(record.getValue(), local.getCache());
           }
         }
 
@@ -282,9 +282,8 @@ public class RegionSnapshotServiceImpl<K, V> implements RegionSnapshotService<K,
             }
 
             final Map<K, V> copy = new HashMap<>(buffer);
-            Future<?> f = GemFireCacheImpl.getExisting("Importing region from snapshot")
-                .getDistributionManager().getWaitingThreadPool().submit((Runnable) () -> local
-                    .basicImportPutAll(copy, !options.shouldInvokeCallbacks()));
+            Future<?> f = local.getCache().getDistributionManager().getWaitingThreadPool().submit(
+                (Runnable) () -> local.basicImportPutAll(copy, !options.shouldInvokeCallbacks()));
 
             puts.addLast(f);
             buffer.clear();
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/GatewayReceiverCommand.java b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/GatewayReceiverCommand.java
index a6fa57b3..9119df0 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/GatewayReceiverCommand.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/GatewayReceiverCommand.java
@@ -70,7 +70,7 @@ public class GatewayReceiverCommand extends BaseCommand {
   private void handleRegionNull(ServerConnection servConn, String regionName, int batchId) {
     InternalCache cache = servConn.getCachedRegionHelper().getCache();
     if (cache != null && cache.isCacheAtShutdownAll()) {
-      throw new CacheClosedException("Shutdown occurred during message processing");
+      throw cache.getCacheClosedException("Shutdown occurred during message processing");
     } else {
       String reason = LocalizedStrings.ProcessBatch_WAS_NOT_FOUND_DURING_BATCH_CREATE_REQUEST_0
           .toLocalizedString(new Object[] {regionName, Integer.valueOf(batchId)});
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/PutAll.java b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/PutAll.java
index 8c9b4d1..d385f52 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/PutAll.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/PutAll.java
@@ -150,7 +150,8 @@ public class PutAll extends BaseCommand {
         // byte[] value = valuePart.getSerializedForm();
         Object value;
         if (valuePart.isObject()) {
-          value = CachedDeserializableFactory.create(valuePart.getSerializedForm());
+          value =
+              CachedDeserializableFactory.create(valuePart.getSerializedForm(), region.getCache());
         } else {
           value = valuePart.getSerializedForm();
         }
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/PutAll70.java b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/PutAll70.java
index f344c83..ae3b90f 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/PutAll70.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/PutAll70.java
@@ -167,7 +167,8 @@ public class PutAll70 extends BaseCommand {
           if (skipCallbacks && Token.INVALID.isSerializedValue(valuePart.getSerializedForm())) {
             value = Token.INVALID;
           } else {
-            value = CachedDeserializableFactory.create(valuePart.getSerializedForm());
+            value = CachedDeserializableFactory.create(valuePart.getSerializedForm(),
+                region.getCache());
           }
         } else {
           value = valuePart.getSerializedForm();
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/PutAll80.java b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/PutAll80.java
index 74485a1..fb067d8 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/PutAll80.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/PutAll80.java
@@ -203,7 +203,8 @@ public class PutAll80 extends BaseCommand {
           if (skipCallbacks && Token.INVALID.isSerializedValue(valuePart.getSerializedForm())) {
             value = Token.INVALID;
           } else {
-            value = CachedDeserializableFactory.create(valuePart.getSerializedForm());
+            value = CachedDeserializableFactory.create(valuePart.getSerializedForm(),
+                region.getCache());
           }
         } else {
           value = valuePart.getSerializedForm();
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/TXFailoverCommand.java b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/TXFailoverCommand.java
index 3f492d5..cce6853 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/TXFailoverCommand.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/TXFailoverCommand.java
@@ -47,12 +47,15 @@ public class TXFailoverCommand extends BaseCommand {
     return singleton;
   }
 
-  private TXFailoverCommand() {}
+  TXFailoverCommand() {
+    // nothing
+  }
 
   @Override
   public void cmdExecute(final Message clientMessage, final ServerConnection serverConnection,
       final SecurityService securityService, long start)
       throws IOException, ClassNotFoundException, InterruptedException {
+
     serverConnection.setAsTrue(REQUIRES_RESPONSE);
     // Build the TXId for the transaction
     InternalDistributedMember client =
@@ -71,13 +74,15 @@ public class TXFailoverCommand extends BaseCommand {
       mgr.removeHostedTXState(txId);
       return;
     }
+
     boolean wasInProgress = mgr.setInProgress(true); // fixes bug 43350
     TXStateProxy tx = mgr.getTXState();
     Assert.assertTrue(tx != null);
+
     if (!tx.isRealDealLocal()) {
       // send message to all peers to find out who hosts the transaction
       FindRemoteTXMessageReplyProcessor processor =
-          FindRemoteTXMessage.send(serverConnection.getCache(), txId);
+          sendFindRemoteTXMessage(serverConnection.getCache(), txId);
       try {
         processor.waitForRepliesUninterruptibly();
       } catch (ReplyException e) {
@@ -131,6 +136,10 @@ public class TXFailoverCommand extends BaseCommand {
     serverConnection.setAsTrue(RESPONDED);
   }
 
+  FindRemoteTXMessageReplyProcessor sendFindRemoteTXMessage(InternalCache cache, TXId txId) {
+    return FindRemoteTXMessage.send(cache, txId);
+  }
+
   TXId createTXId(InternalDistributedMember client, int uniqId) {
     return new TXId(client, uniqId);
   }
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/TXSynchronizationCommand.java b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/TXSynchronizationCommand.java
index b7b90d2..41a50f9 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/TXSynchronizationCommand.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/TXSynchronizationCommand.java
@@ -143,7 +143,8 @@ public class TXSynchronizationCommand extends BaseCommand {
             }
           };
           TXSynchronizationRunnable sync =
-              new TXSynchronizationRunnable(beforeCompletion, serverConnection.getAcceptor());
+              new TXSynchronizationRunnable(serverConnection.getCache().getCancelCriterion(),
+                  serverConnection.getAcceptor(), beforeCompletion);
           txProxy.setSynchronizationRunnable(sync);
           Executor exec = InternalDistributedSystem.getConnectedInstance().getDistributionManager()
               .getWaitingThreadPool();
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/tx/ClientTXStateStub.java b/geode-core/src/main/java/org/apache/geode/internal/cache/tx/ClientTXStateStub.java
index 2c52538..f0a3871 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/tx/ClientTXStateStub.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/tx/ClientTXStateStub.java
@@ -32,10 +32,8 @@ import org.apache.geode.cache.client.internal.ServerRegionProxy;
 import org.apache.geode.distributed.DistributedMember;
 import org.apache.geode.distributed.internal.DistributionConfig;
 import org.apache.geode.distributed.internal.DistributionManager;
-import org.apache.geode.distributed.internal.InternalDistributedSystem;
 import org.apache.geode.distributed.internal.ServerLocation;
 import org.apache.geode.distributed.internal.membership.InternalDistributedMember;
-import org.apache.geode.internal.cache.GemFireCacheImpl;
 import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.internal.cache.LocalRegion;
 import org.apache.geode.internal.cache.TXCommitMessage;
@@ -54,19 +52,6 @@ public class ClientTXStateStub extends TXStateStub {
   /** test hook - used to find out what operations were performed in the last tx */
   private static ThreadLocal<List<TransactionalOperation>> recordedTransactionalOperations = null;
 
-  private final ServerRegionProxy firstProxy;
-
-  private ServerLocation serverAffinityLocation;
-
-  /** the operations performed in the current transaction are held in this list */
-  private List<TransactionalOperation> recordedOperations =
-      Collections.synchronizedList(new LinkedList<TransactionalOperation>());
-
-  /** lock request for obtaining local locks */
-  private TXLockRequest lockReq;
-
-  private Runnable internalAfterLocalLocks;
-
   /**
    * System property to disable conflict checks on clients.
    */
@@ -80,6 +65,21 @@ public class ClientTXStateStub extends TXStateStub {
     return !DISABLE_CONFLICT_CHECK_ON_CLIENT || recordedTransactionalOperations != null;
   }
 
+  private final ServerRegionProxy firstProxy;
+  private final InternalCache cache;
+  private final DistributionManager dm;
+
+  /** the operations performed in the current transaction are held in this list */
+  private final List<TransactionalOperation> recordedOperations =
+      Collections.synchronizedList(new LinkedList<TransactionalOperation>());
+
+  private ServerLocation serverAffinityLocation;
+
+  /** lock request for obtaining local locks */
+  private TXLockRequest lockReq;
+
+  private Runnable internalAfterLocalLocks;
+
   private boolean txRolledback = false;
 
   /**
@@ -92,10 +92,12 @@ public class ClientTXStateStub extends TXStateStub {
     recordedTransactionalOperations = t;
   }
 
-  public ClientTXStateStub(TXStateProxy stateProxy, DistributedMember target,
-      LocalRegion firstRegion) {
+  public ClientTXStateStub(InternalCache cache, DistributionManager dm, TXStateProxy stateProxy,
+      DistributedMember target, LocalRegion firstRegion) {
     super(stateProxy, target);
-    firstProxy = firstRegion.getServerProxy();
+    this.cache = cache;
+    this.dm = dm;
+    this.firstProxy = firstRegion.getServerProxy();
     this.firstProxy.getPool().setupServerAffinity(true);
     if (recordedTransactionalOperations != null) {
       recordedTransactionalOperations.set(this.recordedOperations);
@@ -116,19 +118,26 @@ public class ClientTXStateStub extends TXStateStub {
     }
   }
 
+  TXLockRequest createTXLockRequest() {
+    return new TXLockRequest();
+  }
+
+  TXRegionLockRequestImpl createTXRegionLockRequestImpl(InternalCache cache, LocalRegion region) {
+    return new TXRegionLockRequestImpl(cache, region);
+  }
+
   /**
    * Lock the keys in a local transaction manager
    *
    * @throws CommitConflictException if the key is already locked by some other transaction
    */
   private void obtainLocalLocks() {
-    lockReq = new TXLockRequest();
-    InternalCache cache = GemFireCacheImpl.getExisting("");
+    lockReq = createTXLockRequest();
     for (TransactionalOperation txOp : this.recordedOperations) {
       if (ServerRegionOperation.lockKeyForTx(txOp.getOperation())) {
         TXRegionLockRequest rlr = lockReq.getRegionLockRequest(txOp.getRegionName());
         if (rlr == null) {
-          rlr = new TXRegionLockRequestImpl(cache.getRegionByPath(txOp.getRegionName()));
+          rlr = createTXRegionLockRequestImpl(cache, cache.getRegionByPath(txOp.getRegionName()));
           lockReq.addLocalRequest(rlr);
         }
         if (txOp.getOperation() == ServerRegionOperation.PUT_ALL
@@ -159,14 +168,12 @@ public class ClientTXStateStub extends TXStateStub {
       this.internalAfterSendCommit.run();
     }
 
-    InternalCache cache = GemFireCacheImpl.getInstance();
     if (cache == null) {
+      // we can probably delete this block because cache is now a final var
       // fixes bug 42933
       return;
     }
     cache.getCancelCriterion().checkCancelInProgress(null);
-    InternalDistributedSystem ds = cache.getInternalDistributedSystem();
-    DistributionManager dm = ds.getDistributionManager();
 
     txcm.setDM(dm);
     txcm.setAckRequired(false);
@@ -247,6 +254,7 @@ public class ClientTXStateStub extends TXStateStub {
     }
   }
 
+  @Override
   public InternalDistributedMember getOriginatingMember() {
     /*
      * Client member id is implied from the connection so we don't need this
@@ -254,6 +262,7 @@ public class ClientTXStateStub extends TXStateStub {
     return null;
   }
 
+  @Override
   public boolean isMemberIdForwardingRequired() {
     /*
      * Client member id is implied from the connection so we don't need this Forwarding will occur
@@ -262,11 +271,13 @@ public class ClientTXStateStub extends TXStateStub {
     return false;
   }
 
+  @Override
   public TXCommitMessage getCommitMessage() {
     /* client gets the txcommit message during Op processing and doesn't need it here */
     return null;
   }
 
+  @Override
   public void suspend() {
     this.serverAffinityLocation = this.firstProxy.getPool().getServerAffinityLocation();
     this.firstProxy.getPool().releaseServerAffinity();
@@ -276,6 +287,7 @@ public class ClientTXStateStub extends TXStateStub {
     }
   }
 
+  @Override
   public void resume() {
     this.firstProxy.getPool().setupServerAffinity(true);
     this.firstProxy.getPool().setServerAffinityLocation(this.serverAffinityLocation);
@@ -288,6 +300,7 @@ public class ClientTXStateStub extends TXStateStub {
   /**
    * test hook - maintain a list of tx operations
    */
+  @Override
   public void recordTXOperation(ServerRegionDataAccess region, ServerRegionOperation op, Object key,
       Object arguments[]) {
     if (ClientTXStateStub.transactionRecordingEnabled()) {
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/tx/DistClientTXStateStub.java b/geode-core/src/main/java/org/apache/geode/internal/cache/tx/DistClientTXStateStub.java
index 6356f7a..1464124 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/tx/DistClientTXStateStub.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/tx/DistClientTXStateStub.java
@@ -25,24 +25,16 @@ import org.apache.geode.internal.cache.DistTXCommitMessage;
 import org.apache.geode.internal.cache.DistTXCoordinatorInterface;
 import org.apache.geode.internal.cache.DistTXPrecommitMessage;
 import org.apache.geode.internal.cache.DistTXRollbackMessage;
+import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.internal.cache.LocalRegion;
 import org.apache.geode.internal.cache.TXStateProxy;
 import org.apache.geode.internal.i18n.LocalizedStrings;
 
-/**
- *
- */
 public class DistClientTXStateStub extends ClientTXStateStub implements DistTXCoordinatorInterface {
 
-  /**
-   * @param stateProxy
-   * @param target
-   * @param firstRegion
-   */
-  public DistClientTXStateStub(TXStateProxy stateProxy, DistributedMember target,
-      LocalRegion firstRegion) {
-    super(stateProxy, target, firstRegion);
-    // TODO Auto-generated constructor stub
+  public DistClientTXStateStub(InternalCache cache, DistributionManager dm, TXStateProxy stateProxy,
+      DistributedMember target, LocalRegion firstRegion) {
+    super(cache, dm, stateProxy, target, firstRegion);
   }
 
   @Override
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/tx/DistTxEntryEvent.java b/geode-core/src/main/java/org/apache/geode/internal/cache/tx/DistTxEntryEvent.java
index 2702ccd..85d1bad 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/tx/DistTxEntryEvent.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/tx/DistTxEntryEvent.java
@@ -42,6 +42,8 @@ public class DistTxEntryEvent extends EntryEventImpl {
   protected static final byte HAS_PUTALL_OP = 0x1;
   protected static final byte HAS_REMOVEALL_OP = 0x2;
 
+  private String regionName;
+
   /**
    * TODO DISTTX: callers of this constructor need to make sure that release is called. In general
    * the distributed tx code needs to be reviewed to see if it correctly handles off-heap.
@@ -54,6 +56,10 @@ public class DistTxEntryEvent extends EntryEventImpl {
   // For Serialization
   public DistTxEntryEvent() {}
 
+  public String getRegionName() {
+    return this.regionName;
+  }
+
   @Override
   public Version[] getSerializationVersions() {
     // TODO Auto-generated method stub
@@ -96,9 +102,7 @@ public class DistTxEntryEvent extends EntryEventImpl {
   @Override
   public void fromData(DataInput in) throws IOException, ClassNotFoundException {
     this.eventID = (EventID) DataSerializer.readObject(in);
-    String regionName = DataSerializer.readString(in);
-    InternalCache cache = GemFireCacheImpl.getInstance();
-    this.region = (LocalRegion) cache.getRegion(regionName);
+    this.regionName = DataSerializer.readString(in);
     this.op = Operation.fromOrdinal(in.readByte());
     Object key = DataSerializer.readObject(in);
     Integer bucketId = DataSerializer.readInteger(in);
@@ -168,11 +172,11 @@ public class DistTxEntryEvent extends EntryEventImpl {
         }
       }
     }
-    // TODO DISTTX: release this event?
-    EntryEventImpl e = EntryEventImpl.create(this.region, Operation.PUTALL_CREATE, null, null, null,
-        true, this.getDistributedMember(), true, true);
+    this.op = Operation.PUTALL_CREATE;
+    this.setOriginRemote(true);
+    this.setGenerateCallbacks(true);
 
-    this.putAllOp = new DistributedPutAllOperation(e, putAllSize, false /* [DISTTX] TODO */);
+    this.putAllOp = new DistributedPutAllOperation(this, putAllSize, false /* [DISTTX] TODO */);
     this.putAllOp.setPutAllEntryData(putAllEntries);
   }
 
@@ -224,11 +228,12 @@ public class DistTxEntryEvent extends EntryEventImpl {
         removeAllData[i].versionTag = versionTags.get(i);
       }
     }
-    // TODO DISTTX: release this event
-    EntryEventImpl e = EntryEventImpl.create(this.region, Operation.REMOVEALL_DESTROY, null, null,
-        null, true, this.getDistributedMember(), true, true);
+    this.op = Operation.REMOVEALL_DESTROY;
+    this.setOriginRemote(true);
+    this.setGenerateCallbacks(true);
+
     this.removeAllOp =
-        new DistributedRemoveAllOperation(e, removeAllSize, false /* [DISTTX] TODO */);
+        new DistributedRemoveAllOperation(this, removeAllSize, false /* [DISTTX] TODO */);
     this.removeAllOp.setRemoveAllEntryData(removeAllData);
   }
 
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/tx/PartitionedTXRegionStub.java b/geode-core/src/main/java/org/apache/geode/internal/cache/tx/PartitionedTXRegionStub.java
index d8c9673..acb80f9 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/tx/PartitionedTXRegionStub.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/tx/PartitionedTXRegionStub.java
@@ -402,7 +402,7 @@ public class PartitionedTXRegionStub extends AbstractPeerTXRegionStub {
   public void postPutAll(DistributedPutAllOperation putallO, VersionedObjectList successfulPuts,
       LocalRegion r) throws TransactionException {
     if (r.getCache().isCacheAtShutdownAll()) {
-      throw new CacheClosedException("Cache is shutting down");
+      throw r.getCache().getCacheClosedException("Cache is shutting down");
     }
 
     PartitionedRegion pr = (PartitionedRegion) r;
@@ -462,7 +462,7 @@ public class PartitionedTXRegionStub extends AbstractPeerTXRegionStub {
   public void postRemoveAll(DistributedRemoveAllOperation op, VersionedObjectList successfulOps,
       LocalRegion r) {
     if (r.getCache().isCacheAtShutdownAll()) {
-      throw new CacheClosedException("Cache is shutting down");
+      throw r.getCache().getCacheClosedException("Cache is shutting down");
     }
 
     PartitionedRegion pr = (PartitionedRegion) r;
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/wan/GatewaySenderEventImpl.java b/geode-core/src/main/java/org/apache/geode/internal/cache/wan/GatewaySenderEventImpl.java
index 5b1ba54..2748c7d 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/wan/GatewaySenderEventImpl.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/wan/GatewaySenderEventImpl.java
@@ -487,39 +487,6 @@ public class GatewaySenderEventImpl
   }
 
   /**
-   * Return the value as a byte[] array, if it is plain byte array, otherwise return a cache
-   * deserializable or plain object, depending on if the currently held form of the object is
-   * serialized or not.
-   *
-   * If the object is held off heap, this will copy it to the heap return the heap copy.
-   *
-   * //OFFHEAP TODO: Optimize callers by returning a reference to the off heap value
-   */
-  public Object getValue() {
-    Object rawValue = this.value;
-    if (rawValue == null) {
-      rawValue = this.substituteValue;
-    }
-    if (rawValue == null) {
-      @Unretained(OffHeapIdentifier.GATEWAY_SENDER_EVENT_IMPL_VALUE)
-      Object vo = this.valueObj;
-      if (vo instanceof StoredObject) {
-        rawValue = ((StoredObject) vo).getValueAsHeapByteArray();
-      } else {
-        rawValue = vo;
-      }
-    }
-    if (valueIsObject == 0x00) {
-      // if the value is a byte array, just return it
-      return rawValue;
-    } else if (rawValue instanceof byte[]) {
-      return CachedDeserializableFactory.create((byte[]) rawValue);
-    } else {
-      return rawValue;
-    }
-  }
-
-  /**
    * Return the currently held form of the object. May return a retained OFF_HEAP_REFERENCE.
    */
   @Retained
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/xmlcache/CacheCreation.java b/geode-core/src/main/java/org/apache/geode/internal/cache/xmlcache/CacheCreation.java
index 291d7bd..65cb986 100755
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/xmlcache/CacheCreation.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/xmlcache/CacheCreation.java
@@ -2174,6 +2174,11 @@ public class CacheCreation implements InternalCache {
   }
 
   @Override
+  public CacheClosedException getCacheClosedException(final String reason) {
+    throw new UnsupportedOperationException(LocalizedStrings.SHOULDNT_INVOKE.toLocalizedString());
+  }
+
+  @Override
   public CacheClosedException getCacheClosedException(final String reason, final Throwable cause) {
     throw new UnsupportedOperationException(LocalizedStrings.SHOULDNT_INVOKE.toLocalizedString());
   }
diff --git a/geode-core/src/main/java/org/apache/geode/internal/offheap/MemoryAllocatorImpl.java b/geode-core/src/main/java/org/apache/geode/internal/offheap/MemoryAllocatorImpl.java
index b87e8dd..db424b6 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/offheap/MemoryAllocatorImpl.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/offheap/MemoryAllocatorImpl.java
@@ -32,6 +32,7 @@ import org.apache.geode.cache.RegionService;
 import org.apache.geode.distributed.internal.DistributionConfig;
 import org.apache.geode.internal.cache.BucketRegion;
 import org.apache.geode.internal.cache.GemFireCacheImpl;
+import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.internal.cache.LocalRegion;
 import org.apache.geode.internal.cache.PartitionedRegion;
 import org.apache.geode.internal.cache.PartitionedRegionDataStore;
@@ -224,9 +225,9 @@ public class MemoryAllocatorImpl implements MemoryAllocator {
     this.stats.incFreeMemory(this.freeList.getTotalMemory());
   }
 
-  public List<OffHeapStoredObject> getLostChunks() {
+  public List<OffHeapStoredObject> getLostChunks(InternalCache cache) {
     List<OffHeapStoredObject> liveChunks = this.freeList.getLiveChunks();
-    List<OffHeapStoredObject> regionChunks = getRegionLiveChunks();
+    List<OffHeapStoredObject> regionChunks = getRegionLiveChunks(cache);
     Set<OffHeapStoredObject> liveChunksSet = new HashSet<>(liveChunks);
     Set<OffHeapStoredObject> regionChunksSet = new HashSet<>(regionChunks);
     liveChunksSet.removeAll(regionChunksSet);
@@ -236,11 +237,10 @@ public class MemoryAllocatorImpl implements MemoryAllocator {
   /**
    * Returns a possibly empty list that contains all the Chunks used by regions.
    */
-  private List<OffHeapStoredObject> getRegionLiveChunks() {
+  private List<OffHeapStoredObject> getRegionLiveChunks(InternalCache cache) {
     ArrayList<OffHeapStoredObject> result = new ArrayList<OffHeapStoredObject>();
-    RegionService gfc = GemFireCacheImpl.getInstance();
-    if (gfc != null) {
-      Iterator<Region<?, ?>> rootIt = gfc.rootRegions().iterator();
+    if (cache != null) {
+      Iterator<Region<?, ?>> rootIt = cache.rootRegions().iterator();
       while (rootIt.hasNext()) {
         Region<?, ?> rr = rootIt.next();
         getRegionLiveChunks(rr, result);
@@ -502,9 +502,9 @@ public class MemoryAllocatorImpl implements MemoryAllocator {
     }
   }
 
-  public synchronized List<MemoryBlock> getOrphans() {
+  public synchronized List<MemoryBlock> getOrphans(InternalCache cache) {
     List<OffHeapStoredObject> liveChunks = this.freeList.getLiveChunks();
-    List<OffHeapStoredObject> regionChunks = getRegionLiveChunks();
+    List<OffHeapStoredObject> regionChunks = getRegionLiveChunks(cache);
     liveChunks.removeAll(regionChunks);
     List<MemoryBlock> orphans = new ArrayList<MemoryBlock>();
     for (OffHeapStoredObject chunk : liveChunks) {
diff --git a/geode-core/src/main/java/org/apache/geode/internal/offheap/OffHeapHelper.java b/geode-core/src/main/java/org/apache/geode/internal/offheap/OffHeapHelper.java
index 79248c3..72d0b86 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/offheap/OffHeapHelper.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/offheap/OffHeapHelper.java
@@ -15,6 +15,7 @@
 package org.apache.geode.internal.offheap;
 
 import org.apache.geode.internal.cache.CachedDeserializableFactory;
+import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.internal.offheap.annotations.Released;
 import org.apache.geode.internal.offheap.annotations.Retained;
 import org.apache.geode.internal.offheap.annotations.Unretained;
@@ -46,13 +47,13 @@ public class OffHeapHelper {
    * @param v If this value is off-heap then the caller must have already retained it.
    * @return the heap copy to use in place of v
    */
-  public static Object copyAndReleaseIfNeeded(@Released Object v) {
+  public static Object copyAndReleaseIfNeeded(@Released Object v, InternalCache cache) {
     if (v instanceof StoredObject) {
       @Unretained
       StoredObject ohv = (StoredObject) v;
       try {
         if (ohv.isSerialized()) {
-          return CachedDeserializableFactory.create(ohv.getSerializedValue());
+          return CachedDeserializableFactory.create(ohv.getSerializedValue(), cache);
         } else {
           // it is a byte[]
           return ohv.getDeserializedForReading();
@@ -75,12 +76,12 @@ public class OffHeapHelper {
    * @param v possible OFF_HEAP_REFERENCE
    * @return v or a heap copy of v
    */
-  public static Object copyIfNeeded(@Unretained Object v) {
+  public static Object copyIfNeeded(@Unretained Object v, InternalCache cache) {
     if (v instanceof StoredObject) {
       @Unretained
       StoredObject ohv = (StoredObject) v;
       if (ohv.isSerialized()) {
-        v = CachedDeserializableFactory.create(ohv.getSerializedValue());
+        v = CachedDeserializableFactory.create(ohv.getSerializedValue(), cache);
       } else {
         // it is a byte[]
         v = ohv.getDeserializedForReading();
diff --git a/geode-core/src/main/java/org/apache/geode/internal/offheap/OffHeapRegionEntryHelper.java b/geode-core/src/main/java/org/apache/geode/internal/offheap/OffHeapRegionEntryHelper.java
index b913aea..08e768b 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/offheap/OffHeapRegionEntryHelper.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/offheap/OffHeapRegionEntryHelper.java
@@ -99,7 +99,7 @@ public class OffHeapRegionEntryHelper {
           if (chunk.isSerialized()) {
             // return a VMCachedDeserializable with the decompressed serialized bytes since chunk is
             // serialized
-            result = CachedDeserializableFactory.create(decompressedBytes);
+            result = CachedDeserializableFactory.create(decompressedBytes, context.getCache());
           } else {
             // return a byte[] since chunk is not serialized
             result = decompressedBytes;
@@ -122,7 +122,7 @@ public class OffHeapRegionEntryHelper {
         if (daa.isSerialized()) {
           // return a VMCachedDeserializable with the decompressed serialized bytes since daa is
           // serialized
-          result = CachedDeserializableFactory.create(decompressedBytes);
+          result = CachedDeserializableFactory.create(decompressedBytes, context.getCache());
         } else {
           // return a byte[] since daa is not serialized
           result = decompressedBytes;
diff --git a/geode-core/src/main/java/org/apache/geode/management/cli/CommandService.java b/geode-core/src/main/java/org/apache/geode/management/cli/CommandService.java
index 698461a..9b59aeb 100644
--- a/geode-core/src/main/java/org/apache/geode/management/cli/CommandService.java
+++ b/geode-core/src/main/java/org/apache/geode/management/cli/CommandService.java
@@ -112,9 +112,11 @@ public abstract class CommandService {
    */
   public static CommandService createLocalCommandService(Cache cache)
       throws CommandServiceException {
-    if (cache == null || cache.isClosed()) {
-      throw new CacheClosedException(
-          "Can not create command service as cache doesn't exist or cache is closed.");
+    if (cache == null) {
+      throw new CacheClosedException("Can not create command service as cache doesn't exist.");
+    } else if (cache.isClosed()) {
+      throw ((InternalCache) cache)
+          .getCacheClosedException("Can not create command service as cache is closed.");
     }
 
     if (localCommandService == null || !localCommandService.isUsable()) {
diff --git a/geode-core/src/main/java/org/apache/geode/pdx/internal/ClientTypeRegistration.java b/geode-core/src/main/java/org/apache/geode/pdx/internal/ClientTypeRegistration.java
index c10de03..22d0384 100644
--- a/geode-core/src/main/java/org/apache/geode/pdx/internal/ClientTypeRegistration.java
+++ b/geode-core/src/main/java/org/apache/geode/pdx/internal/ClientTypeRegistration.java
@@ -116,9 +116,9 @@ public class ClientTypeRegistration implements TypeRegistration {
 
     if (pools.isEmpty()) {
       if (this.cache.isClosed()) {
-        throw new CacheClosedException("PDX detected cache was closed");
+        throw cache.getCacheClosedException("PDX detected cache was closed");
       }
-      throw new CacheClosedException(
+      throw cache.getCacheClosedException(
           "Client pools have been closed so the PDX type registry is not available.");
     }
     return pools;
diff --git a/geode-core/src/test/java/org/apache/geode/cache30/DistributedAckOverflowRegionCCEOffHeapDUnitTest.java b/geode-core/src/test/java/org/apache/geode/cache30/DistributedAckOverflowRegionCCEOffHeapDUnitTest.java
index bdf648c..4d2d594 100755
--- a/geode-core/src/test/java/org/apache/geode/cache30/DistributedAckOverflowRegionCCEOffHeapDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/cache30/DistributedAckOverflowRegionCCEOffHeapDUnitTest.java
@@ -48,7 +48,7 @@ public class DistributedAckOverflowRegionCCEOffHeapDUnitTest
       @Override
       public void run() {
         if (hasCache()) {
-          OffHeapTestUtil.checkOrphans();
+          OffHeapTestUtil.checkOrphans(getCache());
         }
       }
     };
diff --git a/geode-core/src/test/java/org/apache/geode/cache30/DistributedAckPersistentRegionCCEOffHeapDUnitTest.java b/geode-core/src/test/java/org/apache/geode/cache30/DistributedAckPersistentRegionCCEOffHeapDUnitTest.java
index 5839da7..6a4f160 100755
--- a/geode-core/src/test/java/org/apache/geode/cache30/DistributedAckPersistentRegionCCEOffHeapDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/cache30/DistributedAckPersistentRegionCCEOffHeapDUnitTest.java
@@ -49,7 +49,7 @@ public class DistributedAckPersistentRegionCCEOffHeapDUnitTest
       @Override
       public void run() {
         if (hasCache()) {
-          OffHeapTestUtil.checkOrphans();
+          OffHeapTestUtil.checkOrphans(getCache());
         }
       }
     };
diff --git a/geode-core/src/test/java/org/apache/geode/cache30/DistributedAckRegionCCEOffHeapDUnitTest.java b/geode-core/src/test/java/org/apache/geode/cache30/DistributedAckRegionCCEOffHeapDUnitTest.java
index 683880f..212a8cf 100755
--- a/geode-core/src/test/java/org/apache/geode/cache30/DistributedAckRegionCCEOffHeapDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/cache30/DistributedAckRegionCCEOffHeapDUnitTest.java
@@ -43,7 +43,7 @@ public class DistributedAckRegionCCEOffHeapDUnitTest extends DistributedAckRegio
       @Override
       public void run() {
         if (hasCache()) {
-          OffHeapTestUtil.checkOrphans();
+          OffHeapTestUtil.checkOrphans(getCache());
         }
       }
     };
diff --git a/geode-core/src/test/java/org/apache/geode/cache30/DistributedAckRegionOffHeapDUnitTest.java b/geode-core/src/test/java/org/apache/geode/cache30/DistributedAckRegionOffHeapDUnitTest.java
index 5630be4..8680f68 100755
--- a/geode-core/src/test/java/org/apache/geode/cache30/DistributedAckRegionOffHeapDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/cache30/DistributedAckRegionOffHeapDUnitTest.java
@@ -43,7 +43,7 @@ public class DistributedAckRegionOffHeapDUnitTest extends DistributedAckRegionDU
       @Override
       public void run() {
         if (hasCache()) {
-          OffHeapTestUtil.checkOrphans();
+          OffHeapTestUtil.checkOrphans(getCache());
         }
       }
     };
diff --git a/geode-core/src/test/java/org/apache/geode/cache30/DistributedNoAckRegionCCEOffHeapDUnitTest.java b/geode-core/src/test/java/org/apache/geode/cache30/DistributedNoAckRegionCCEOffHeapDUnitTest.java
index bac47c9..7f7ca81 100755
--- a/geode-core/src/test/java/org/apache/geode/cache30/DistributedNoAckRegionCCEOffHeapDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/cache30/DistributedNoAckRegionCCEOffHeapDUnitTest.java
@@ -43,7 +43,7 @@ public class DistributedNoAckRegionCCEOffHeapDUnitTest extends DistributedNoAckR
       @Override
       public void run() {
         if (hasCache()) {
-          OffHeapTestUtil.checkOrphans();
+          OffHeapTestUtil.checkOrphans(getCache());
         }
       }
     };
diff --git a/geode-core/src/test/java/org/apache/geode/cache30/DistributedNoAckRegionOffHeapDUnitTest.java b/geode-core/src/test/java/org/apache/geode/cache30/DistributedNoAckRegionOffHeapDUnitTest.java
index 331db07..ce26e12 100755
--- a/geode-core/src/test/java/org/apache/geode/cache30/DistributedNoAckRegionOffHeapDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/cache30/DistributedNoAckRegionOffHeapDUnitTest.java
@@ -47,7 +47,7 @@ public class DistributedNoAckRegionOffHeapDUnitTest extends DistributedNoAckRegi
       @Override
       public void run() {
         if (hasCache()) {
-          OffHeapTestUtil.checkOrphans();
+          OffHeapTestUtil.checkOrphans(getCache());
         }
       }
     };
diff --git a/geode-core/src/test/java/org/apache/geode/cache30/GlobalRegionCCEOffHeapDUnitTest.java b/geode-core/src/test/java/org/apache/geode/cache30/GlobalRegionCCEOffHeapDUnitTest.java
index 3069520..1f9f84a 100755
--- a/geode-core/src/test/java/org/apache/geode/cache30/GlobalRegionCCEOffHeapDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/cache30/GlobalRegionCCEOffHeapDUnitTest.java
@@ -43,7 +43,7 @@ public class GlobalRegionCCEOffHeapDUnitTest extends GlobalRegionCCEDUnitTest {
       @Override
       public void run() {
         if (hasCache()) {
-          OffHeapTestUtil.checkOrphans();
+          OffHeapTestUtil.checkOrphans(getCache());
         }
       }
     };
diff --git a/geode-core/src/test/java/org/apache/geode/cache30/GlobalRegionOffHeapDUnitTest.java b/geode-core/src/test/java/org/apache/geode/cache30/GlobalRegionOffHeapDUnitTest.java
index 83aa6dc..91117c2 100755
--- a/geode-core/src/test/java/org/apache/geode/cache30/GlobalRegionOffHeapDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/cache30/GlobalRegionOffHeapDUnitTest.java
@@ -45,7 +45,7 @@ public class GlobalRegionOffHeapDUnitTest extends GlobalRegionDUnitTest {
       @Override
       public void run() {
         if (hasCache()) {
-          OffHeapTestUtil.checkOrphans();
+          OffHeapTestUtil.checkOrphans(getCache());
         }
       }
     };
diff --git a/geode-core/src/test/java/org/apache/geode/cache30/OffHeapLRUEvictionControllerDUnitTest.java b/geode-core/src/test/java/org/apache/geode/cache30/OffHeapLRUEvictionControllerDUnitTest.java
index fcf1e0e..e1dd9aa 100644
--- a/geode-core/src/test/java/org/apache/geode/cache30/OffHeapLRUEvictionControllerDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/cache30/OffHeapLRUEvictionControllerDUnitTest.java
@@ -48,7 +48,7 @@ public class OffHeapLRUEvictionControllerDUnitTest extends LRUEvictionController
       @Override
       public void run() {
         if (hasCache()) {
-          OffHeapTestUtil.checkOrphans();
+          OffHeapTestUtil.checkOrphans(getCache());
         }
       }
     };
diff --git a/geode-core/src/test/java/org/apache/geode/cache30/PartitionedRegionOffHeapDUnitTest.java b/geode-core/src/test/java/org/apache/geode/cache30/PartitionedRegionOffHeapDUnitTest.java
index c46bcf0..ab3bae6 100755
--- a/geode-core/src/test/java/org/apache/geode/cache30/PartitionedRegionOffHeapDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/cache30/PartitionedRegionOffHeapDUnitTest.java
@@ -42,7 +42,7 @@ public class PartitionedRegionOffHeapDUnitTest extends PartitionedRegionDUnitTes
       @Override
       public void run() {
         if (hasCache()) {
-          OffHeapTestUtil.checkOrphans();
+          OffHeapTestUtil.checkOrphans(getCache());
         }
       }
     };
diff --git a/geode-core/src/test/java/org/apache/geode/internal/PutAllOperationContextJUnitTest.java b/geode-core/src/test/java/org/apache/geode/internal/PutAllOperationContextJUnitTest.java
index 13cc728..5f88a9a 100644
--- a/geode-core/src/test/java/org/apache/geode/internal/PutAllOperationContextJUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/PutAllOperationContextJUnitTest.java
@@ -121,7 +121,7 @@ public class PutAllOperationContextJUnitTest {
   public void testCachedDeserializable() {
     LinkedHashMap<String, Object> m = new LinkedHashMap<>();
     Object v = Integer.valueOf(99);
-    CachedDeserializable cd = CachedDeserializableFactory.create(v, 24);
+    CachedDeserializable cd = CachedDeserializableFactory.create(v, 24, null);
     m.put("cd", cd);
     PutAllOperationContext paoc = new PutAllOperationContext(m);
     Map<String, Object> opMap = paoc.getMap();
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/RequestFilterInfoMessageTest.java b/geode-core/src/test/java/org/apache/geode/internal/cache/CacheProfileTest.java
similarity index 52%
copy from geode-core/src/test/java/org/apache/geode/internal/cache/RequestFilterInfoMessageTest.java
copy to geode-core/src/test/java/org/apache/geode/internal/cache/CacheProfileTest.java
index 062b0f0..d9b400f 100644
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/RequestFilterInfoMessageTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/CacheProfileTest.java
@@ -14,23 +14,44 @@
  */
 package org.apache.geode.internal.cache;
 
-import static org.assertj.core.api.Assertions.assertThat;
 import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
 
+import org.junit.Before;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
-import org.apache.geode.internal.cache.InitialImageOperation.RequestFilterInfoMessage;
+import org.apache.geode.distributed.internal.ClusterDistributionManager;
+import org.apache.geode.internal.cache.CacheDistributionAdvisor.CacheProfile;
 import org.apache.geode.test.junit.categories.UnitTest;
 
 @Category(UnitTest.class)
-public class RequestFilterInfoMessageTest {
+public class CacheProfileTest {
+
+  private ClusterDistributionManager dm;
+  private InternalCache cache;
+  private String adviseePath;
+  private LocalRegion region;
+
+  @Before
+  public void setUp() {
+    adviseePath = "adviseePath";
+
+    dm = mock(ClusterDistributionManager.class);
+    cache = mock(InternalCache.class);
+    region = mock(LocalRegion.class);
+
+    when(dm.getCache()).thenReturn(cache);
+    when(cache.getRegionByPath(adviseePath)).thenReturn(region);
+  }
 
   @Test
-  public void shouldBeMockable() throws Exception {
-    RequestFilterInfoMessage mockRequestFilterInfoMessage = mock(RequestFilterInfoMessage.class);
-    when(mockRequestFilterInfoMessage.getProcessorType()).thenReturn(1);
-    assertThat(mockRequestFilterInfoMessage.getProcessorType()).isEqualTo(1);
+  public void getsRegionFromCacheFromDM() {
+    CacheProfile profile = new CacheProfile();
+    profile.processIncoming(dm, adviseePath, false, false, null);
+    verify(dm, times(1)).getCache();
+    verify(cache, times(1)).getRegionByPath(adviseePath);
   }
 }
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/ClientServerGetAllDUnitTest.java b/geode-core/src/test/java/org/apache/geode/internal/cache/ClientServerGetAllDUnitTest.java
index 47c2c39..372d62f 100755
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/ClientServerGetAllDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/ClientServerGetAllDUnitTest.java
@@ -846,7 +846,7 @@ public class ClientServerGetAllDUnitTest extends ClientServerTestCase {
       public void run2() throws CacheException {
         Region region = getRootRegion(regionName);
         region.close();
-        OffHeapTestUtil.checkOrphans();
+        OffHeapTestUtil.checkOrphans(getCache());
       }
     });
 
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/RequestFilterInfoMessageTest.java b/geode-core/src/test/java/org/apache/geode/internal/cache/DiskStoreMonitorTest.java
similarity index 50%
copy from geode-core/src/test/java/org/apache/geode/internal/cache/RequestFilterInfoMessageTest.java
copy to geode-core/src/test/java/org/apache/geode/internal/cache/DiskStoreMonitorTest.java
index 062b0f0..9f70b3a 100644
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/RequestFilterInfoMessageTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/DiskStoreMonitorTest.java
@@ -15,22 +15,43 @@
 package org.apache.geode.internal.cache;
 
 import static org.assertj.core.api.Assertions.assertThat;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
 
+import java.io.File;
+
+import org.junit.Before;
+import org.junit.Rule;
 import org.junit.Test;
+import org.junit.contrib.java.lang.system.RestoreSystemProperties;
 import org.junit.experimental.categories.Category;
 
-import org.apache.geode.internal.cache.InitialImageOperation.RequestFilterInfoMessage;
 import org.apache.geode.test.junit.categories.UnitTest;
 
 @Category(UnitTest.class)
-public class RequestFilterInfoMessageTest {
+public class DiskStoreMonitorTest {
+
+  @Rule
+  public RestoreSystemProperties restoreSystemProperties = new RestoreSystemProperties();
+
+  @Before
+  public void setup() {
+    System.setProperty(DiskStoreMonitor.DISK_USAGE_DISABLE_MONITORING, "true");
+  }
+
+  @Test
+  public void usesCurrentDirWhenLogFileIsNull() {
+    DiskStoreMonitor diskStoreMonitor = new DiskStoreMonitor(null);
+    assertThat(diskStoreMonitor.getLogDisk().dir()).isEqualTo(new File("."));
+  }
+
+  @Test
+  public void usesLogFileParentDir() {
+    DiskStoreMonitor diskStoreMonitor = new DiskStoreMonitor(new File("parent", "child"));
+    assertThat(diskStoreMonitor.getLogDisk().dir()).isEqualTo(new File("parent"));
+  }
 
   @Test
-  public void shouldBeMockable() throws Exception {
-    RequestFilterInfoMessage mockRequestFilterInfoMessage = mock(RequestFilterInfoMessage.class);
-    when(mockRequestFilterInfoMessage.getProcessorType()).thenReturn(1);
-    assertThat(mockRequestFilterInfoMessage.getProcessorType()).isEqualTo(1);
+  public void usesCurrentDirWhenLogFileParentIsNull() {
+    DiskStoreMonitor diskStoreMonitor = new DiskStoreMonitor(new File("child"));
+    assertThat(diskStoreMonitor.getLogDisk().dir()).isEqualTo(new File("."));
   }
 }
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/DistrbutedRegionProfileOffHeapDUnitTest.java b/geode-core/src/test/java/org/apache/geode/internal/cache/DistrbutedRegionProfileOffHeapDUnitTest.java
index 4252510..b5e9198 100644
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/DistrbutedRegionProfileOffHeapDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/DistrbutedRegionProfileOffHeapDUnitTest.java
@@ -46,7 +46,7 @@ public class DistrbutedRegionProfileOffHeapDUnitTest extends JUnit4CacheTestCase
       @Override
       public void run() {
         if (hasCache()) {
-          OffHeapTestUtil.checkOrphans();
+          OffHeapTestUtil.checkOrphans(getCache());
         }
       }
     };
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/GemFireCacheImplTest.java b/geode-core/src/test/java/org/apache/geode/internal/cache/GemFireCacheImplTest.java
index ee9ca16..cd33138 100644
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/GemFireCacheImplTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/GemFireCacheImplTest.java
@@ -24,9 +24,12 @@ import java.util.concurrent.ThreadPoolExecutor;
 import java.util.concurrent.TimeUnit;
 
 import org.awaitility.Awaitility;
+import org.junit.After;
+import org.junit.Before;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
+import org.apache.geode.cache.CacheClosedException;
 import org.apache.geode.distributed.internal.InternalDistributedSystem;
 import org.apache.geode.internal.SystemTimer;
 import org.apache.geode.internal.cache.control.InternalResourceManager;
@@ -39,6 +42,23 @@ import org.apache.geode.test.junit.categories.UnitTest;
 @Category(UnitTest.class)
 public class GemFireCacheImplTest {
 
+  private InternalDistributedSystem distributedSystem;
+  private GemFireCacheImpl cache;
+  private CacheConfig cacheConfig;
+
+  @Before
+  public void setup() {
+    distributedSystem = Fakes.distributedSystem();
+    cacheConfig = new CacheConfig();
+  }
+
+  @After
+  public void tearDown() {
+    if (cache != null) {
+      cache.close();
+    }
+  }
+
   @Test
   public void shouldBeMockable() throws Exception {
     GemFireCacheImpl mockGemFireCacheImpl = mock(GemFireCacheImpl.class);
@@ -125,6 +145,77 @@ public class GemFireCacheImplTest {
   }
 
   @Test
+  public void getCacheClosedExceptionWithNoReasonOrCauseGivesExceptionWithoutEither() {
+    cache = GemFireCacheImpl.create(distributedSystem, cacheConfig);
+    CacheClosedException e = cache.getCacheClosedException(null, null);
+    assertThat(e.getCause()).isNull();
+    assertThat(e.getMessage()).isNull();
+  }
+
+  @Test
+  public void getCacheClosedExceptionWithNoCauseGivesExceptionWithReason() {
+    cache = GemFireCacheImpl.create(distributedSystem, cacheConfig);
+    CacheClosedException e = cache.getCacheClosedException("message", null);
+    assertThat(e.getCause()).isNull();
+    assertThat(e.getMessage()).isEqualTo("message");
+  }
+
+  @Test
+  public void getCacheClosedExceptionReturnsExceptionWithProvidedCauseAndReason() {
+    cache = GemFireCacheImpl.create(distributedSystem, cacheConfig);
+    Throwable cause = new Throwable();
+    CacheClosedException e = cache.getCacheClosedException("message", cause);
+    assertThat(e.getCause()).isEqualTo(cause);
+    assertThat(e.getMessage()).isEqualTo("message");
+  }
+
+  @Test
+  public void getCacheClosedExceptionWhenCauseGivenButDisconnectExceptionExistsPrefersCause() {
+    cache = GemFireCacheImpl.create(distributedSystem, cacheConfig);
+    cache.disconnectCause = new Throwable("disconnectCause");
+    Throwable cause = new Throwable();
+    CacheClosedException e = cache.getCacheClosedException("message", cause);
+    assertThat(e.getCause()).isEqualTo(cause);
+    assertThat(e.getMessage()).isEqualTo("message");
+  }
+
+  @Test
+  public void getCacheClosedExceptionWhenNoCauseGivenProvidesDisconnectExceptionIfExists() {
+    cache = GemFireCacheImpl.create(distributedSystem, cacheConfig);
+    Throwable disconnectCause = new Throwable("disconnectCause");
+    cache.disconnectCause = disconnectCause;
+    CacheClosedException e = cache.getCacheClosedException("message", null);
+    assertThat(e.getCause()).isEqualTo(disconnectCause);
+    assertThat(e.getMessage()).isEqualTo("message");
+  }
+
+  @Test
+  public void getCacheClosedExceptionReturnsExceptionWithProvidedReason() {
+    cache = GemFireCacheImpl.create(distributedSystem, cacheConfig);
+    CacheClosedException e = cache.getCacheClosedException("message");
+    assertThat(e.getMessage()).isEqualTo("message");
+    assertThat(e.getCause()).isNull();
+  }
+
+  @Test
+  public void getCacheClosedExceptionReturnsExceptionWithNoMessageWhenReasonNotGiven() {
+    cache = GemFireCacheImpl.create(distributedSystem, cacheConfig);
+    CacheClosedException e = cache.getCacheClosedException(null);
+    assertThat(e.getMessage()).isEqualTo(null);
+    assertThat(e.getCause()).isNull();
+  }
+
+  @Test
+  public void getCacheClosedExceptionReturnsExceptionWithDisconnectCause() {
+    cache = GemFireCacheImpl.create(distributedSystem, cacheConfig);
+    Throwable disconnectCause = new Throwable("disconnectCause");
+    cache.disconnectCause = disconnectCause;
+    CacheClosedException e = cache.getCacheClosedException("message");
+    assertThat(e.getMessage()).isEqualTo("message");
+    assertThat(e.getCause()).isEqualTo(disconnectCause);
+  }
+
+  @Test
   public void testIsMisConfigured() {
     Properties clusterProps = new Properties();
     Properties serverProps = new Properties();
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/GridProfileTest.java b/geode-core/src/test/java/org/apache/geode/internal/cache/GridProfileTest.java
index c2e65ac..d2d7af5 100644
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/GridProfileTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/GridProfileTest.java
@@ -29,6 +29,7 @@ import org.junit.experimental.categories.Category;
 import org.apache.geode.distributed.internal.DistributionAdvisor.Profile;
 import org.apache.geode.distributed.internal.DistributionAdvisor.ProfileId;
 import org.apache.geode.internal.cache.GridAdvisor.GridProfile;
+import org.apache.geode.test.fake.Fakes;
 import org.apache.geode.test.junit.categories.UnitTest;
 
 @Category(UnitTest.class)
@@ -37,6 +38,7 @@ public class GridProfileTest {
   @Test
   public void shouldBeMockable() throws Exception {
     GridProfile mockGridProfile = mock(GridProfile.class);
+    InternalCache cache = Fakes.cache();
     ProfileId mockProfileId = mock(ProfileId.class);
     List<Profile> listOfProfiles = new ArrayList<>();
     listOfProfiles.add(mock(Profile.class));
@@ -48,12 +50,12 @@ public class GridProfileTest {
     mockGridProfile.setHost("host");
     mockGridProfile.setPort(2);
     mockGridProfile.tellLocalControllers(true, true, listOfProfiles);
-    mockGridProfile.tellLocalBridgeServers(true, true, listOfProfiles);
+    mockGridProfile.tellLocalBridgeServers(cache, true, true, listOfProfiles);
 
     verify(mockGridProfile, times(1)).setHost("host");
     verify(mockGridProfile, times(1)).setPort(2);
     verify(mockGridProfile, times(1)).tellLocalControllers(true, true, listOfProfiles);
-    verify(mockGridProfile, times(1)).tellLocalBridgeServers(true, true, listOfProfiles);
+    verify(mockGridProfile, times(1)).tellLocalBridgeServers(cache, true, true, listOfProfiles);
 
     assertThat(mockGridProfile.getHost()).isEqualTo("HOST");
     assertThat(mockGridProfile.getPort()).isEqualTo(1);
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/RequestFilterInfoMessageTest.java b/geode-core/src/test/java/org/apache/geode/internal/cache/InitialImageOperationTest.java
similarity index 56%
copy from geode-core/src/test/java/org/apache/geode/internal/cache/RequestFilterInfoMessageTest.java
copy to geode-core/src/test/java/org/apache/geode/internal/cache/InitialImageOperationTest.java
index 062b0f0..af98d9c 100644
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/RequestFilterInfoMessageTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/InitialImageOperationTest.java
@@ -18,19 +18,39 @@ import static org.assertj.core.api.Assertions.assertThat;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
 
+import org.junit.Before;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
-import org.apache.geode.internal.cache.InitialImageOperation.RequestFilterInfoMessage;
+import org.apache.geode.cache.Scope;
+import org.apache.geode.distributed.internal.ClusterDistributionManager;
 import org.apache.geode.test.junit.categories.UnitTest;
 
 @Category(UnitTest.class)
-public class RequestFilterInfoMessageTest {
+public class InitialImageOperationTest {
+
+  private ClusterDistributionManager dm;
+  private String path;
+  private LocalRegion region;
+  private InternalCache cache;
+
+  @Before
+  public void setUp() {
+    path = "path";
+
+    cache = mock(InternalCache.class);
+    dm = mock(ClusterDistributionManager.class);
+    region = mock(LocalRegion.class);
+
+    when(dm.getCache()).thenReturn(cache);
+    when(cache.getRegionByPath(path)).thenReturn(region);
+    when(region.isInitialized()).thenReturn(true);
+    when(region.getScope()).thenReturn(Scope.DISTRIBUTED_ACK);
+  }
 
   @Test
-  public void shouldBeMockable() throws Exception {
-    RequestFilterInfoMessage mockRequestFilterInfoMessage = mock(RequestFilterInfoMessage.class);
-    when(mockRequestFilterInfoMessage.getProcessorType()).thenReturn(1);
-    assertThat(mockRequestFilterInfoMessage.getProcessorType()).isEqualTo(1);
+  public void getsRegionFromCacheFromDM() {
+    LocalRegion value = InitialImageOperation.getGIIRegion(dm, path, false);
+    assertThat(value).isSameAs(region);
   }
 }
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/NetSearchMessagingDUnitTest.java b/geode-core/src/test/java/org/apache/geode/internal/cache/NetSearchMessagingDUnitTest.java
index a047acc..99df736 100644
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/NetSearchMessagingDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/NetSearchMessagingDUnitTest.java
@@ -191,7 +191,7 @@ public class NetSearchMessagingDUnitTest extends JUnit4CacheTestCase {
           Cache cache = getCache();
           LocalRegion region = (LocalRegion) cache.getRegion("region");
           RegionEntry re = region.getRegionEntry("a");
-          Object o = re.getValueInVM(null);
+          Object o = re.getValueInVM(region);
           LogWriterUtils.getLogWriter().info("key a=" + o);;
           return o == null || o == Token.NOT_AVAILABLE;
         }
@@ -213,7 +213,7 @@ public class NetSearchMessagingDUnitTest extends JUnit4CacheTestCase {
           String[] keys = new String[] {"b", "c", "d", "e", "f"};
           for (String key : keys) {
             RegionEntry re = region.getRegionEntry(key);
-            Object o = re.getValueInVM(null);
+            Object o = re.getValueInVM(region);
             LogWriterUtils.getLogWriter().info("key " + key + "=" + o);
             assertTrue("expected key " + key + " to not be evicted",
                 (o != null) && (o != Token.NOT_AVAILABLE));
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/OffHeapTestUtil.java b/geode-core/src/test/java/org/apache/geode/internal/cache/OffHeapTestUtil.java
index 1758258..9bd9ae2 100644
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/OffHeapTestUtil.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/OffHeapTestUtil.java
@@ -28,7 +28,7 @@ import org.apache.geode.internal.offheap.ReferenceCountHelper;
 @SuppressWarnings("deprecation")
 public class OffHeapTestUtil {
 
-  public static void checkOrphans() {
+  public static void checkOrphans(InternalCache cache) {
     MemoryAllocatorImpl allocator = null;
     try {
       allocator = MemoryAllocatorImpl.getAllocator();
@@ -37,7 +37,7 @@ public class OffHeapTestUtil {
       return;
     }
     long end = System.currentTimeMillis() + 5000;
-    List<MemoryBlock> orphans = allocator.getOrphans();
+    List<MemoryBlock> orphans = allocator.getOrphans(cache);
 
     // Wait for the orphans to go away
     while (orphans != null && !orphans.isEmpty() && System.currentTimeMillis() < end) {
@@ -46,7 +46,7 @@ public class OffHeapTestUtil {
       } catch (InterruptedException e) {
         throw new RuntimeException(e);
       }
-      orphans = allocator.getOrphans();
+      orphans = allocator.getOrphans(null);
     }
 
     if (orphans != null && !orphans.isEmpty()) {
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/OplogJUnitTest.java b/geode-core/src/test/java/org/apache/geode/internal/cache/OplogJUnitTest.java
index 91fb5be..09c24cb 100755
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/OplogJUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/OplogJUnitTest.java
@@ -367,7 +367,7 @@ public class OplogJUnitTest extends DiskRegionTestingBase {
         }
       }
       val = (byte[]) DiskStoreImpl.convertBytesAndBitsIntoObject(
-          dr.getBytesAndBitsWithoutLock(entry.getDiskId(), true, false));
+          dr.getBytesAndBitsWithoutLock(entry.getDiskId(), true, false), (InternalCache) cache);
       for (int i = 0; i < val.length; ++i) {
         if (val[i] != (byte) i) {
           fail("Test for fault in from disk failed");
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/PartitionAttributesImplJUnitTest.java b/geode-core/src/test/java/org/apache/geode/internal/cache/PartitionAttributesImplJUnitTest.java
index b5fcbff..6c37da5 100755
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/PartitionAttributesImplJUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/PartitionAttributesImplJUnitTest.java
@@ -14,7 +14,13 @@
  */
 package org.apache.geode.internal.cache;
 
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.junit.Assert.*;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
 
 import java.util.Properties;
 
@@ -23,11 +29,14 @@ import org.junit.Ignore;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
+import org.apache.geode.cache.Cache;
 import org.apache.geode.cache.EntryOperation;
+import org.apache.geode.cache.PartitionAttributes;
 import org.apache.geode.cache.PartitionAttributesFactory;
 import org.apache.geode.cache.PartitionResolver;
 import org.apache.geode.cache.Region;
 import org.apache.geode.cache.partition.PartitionListener;
+import org.apache.geode.test.fake.Fakes;
 import org.apache.geode.test.junit.categories.UnitTest;
 
 /**
@@ -61,6 +70,7 @@ public class PartitionAttributesImplJUnitTest {
 
   private FixedPartitionAttributesImpl fixedPartitionAttributes;
   private PartitionListener partitionListener;
+  private Cache cache;
 
   @Before
   public void before() {
@@ -78,6 +88,7 @@ public class PartitionAttributesImplJUnitTest {
 
     this.localMaxMemory = 123;
     this.offHeap = false;
+    this.cache = Fakes.cache();
 
     this.partitionResolver = new PartitionResolver<Object, Object>() {
       @Override
@@ -473,6 +484,42 @@ public class PartitionAttributesImplJUnitTest {
     assertNotEquals(instance, other);
   }
 
+  @Test
+  public void validateColocationWithNonExistingRegion() {
+    PartitionAttributesImpl instance = createPartitionAttributesImpl();
+    instance.setColocatedWith("nonExistingRegion");
+    assertThatThrownBy(() -> instance.validateColocation(cache))
+        .isInstanceOf(IllegalStateException.class)
+        .hasMessageContaining("It should be created before setting");
+  }
+
+  @Test
+  public void validateColocationWithNonPartitionedRegion() {
+    Region region = mock(Region.class);
+    when(cache.getRegion("nonPrRegion")).thenReturn(region);
+    PartitionAttributesImpl instance = createPartitionAttributesImpl();
+    instance.setColocatedWith("nonPrRegion");
+
+    assertThatThrownBy(() -> instance.validateColocation(cache))
+        .isInstanceOf(IllegalStateException.class)
+        .hasMessageContaining("supported only for PartitionedRegions");
+  }
+
+  @Test
+  public void validateColocationWithSimilarPartitionedRegion() {
+    PartitionedRegion region = mock(PartitionedRegion.class);
+    PartitionAttributes prAttributes = mock(PartitionAttributes.class);
+    when(cache.getRegion("PrRegion")).thenReturn(region);
+    when(region.getPartitionAttributes()).thenReturn(prAttributes);
+
+    PartitionAttributesImpl instance = createPartitionAttributesImpl();
+    when(prAttributes.getTotalNumBuckets()).thenReturn(instance.getTotalNumBuckets());
+    when(prAttributes.getRedundantCopies()).thenReturn(instance.getRedundantCopies());
+    instance.setColocatedWith("PrRegion");
+    instance.validateColocation(cache);
+    verify(cache, times(1)).getRegion("PrRegion");
+  }
+
   private void fillInForEqualityTest(PartitionAttributesImpl instance) {
     instance.setRedundantCopies(this.redundancy);
     instance.setLocalMaxMemory(this.localMaxMemory);
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/PartitionedRegionLocalMaxMemoryOffHeapDUnitTest.java b/geode-core/src/test/java/org/apache/geode/internal/cache/PartitionedRegionLocalMaxMemoryOffHeapDUnitTest.java
index 42b6178..2a14301 100755
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/PartitionedRegionLocalMaxMemoryOffHeapDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/PartitionedRegionLocalMaxMemoryOffHeapDUnitTest.java
@@ -44,7 +44,7 @@ public class PartitionedRegionLocalMaxMemoryOffHeapDUnitTest
       @Override
       public void run() {
         if (hasCache()) {
-          OffHeapTestUtil.checkOrphans();
+          OffHeapTestUtil.checkOrphans(getCache());
         }
       }
     };
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/PartitionedRegionOffHeapEvictionDUnitTest.java b/geode-core/src/test/java/org/apache/geode/internal/cache/PartitionedRegionOffHeapEvictionDUnitTest.java
index 9b269aa..e10b5f4 100644
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/PartitionedRegionOffHeapEvictionDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/PartitionedRegionOffHeapEvictionDUnitTest.java
@@ -38,7 +38,7 @@ public class PartitionedRegionOffHeapEvictionDUnitTest extends PartitionedRegion
       @Override
       public void run() {
         if (hasCache()) {
-          OffHeapTestUtil.checkOrphans();
+          OffHeapTestUtil.checkOrphans(getCache());
         }
       }
     };
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/RequestFilterInfoMessageTest.java b/geode-core/src/test/java/org/apache/geode/internal/cache/RegionCommitTest.java
similarity index 52%
copy from geode-core/src/test/java/org/apache/geode/internal/cache/RequestFilterInfoMessageTest.java
copy to geode-core/src/test/java/org/apache/geode/internal/cache/RegionCommitTest.java
index 062b0f0..7f4fae8 100644
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/RequestFilterInfoMessageTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/RegionCommitTest.java
@@ -18,19 +18,41 @@ import static org.assertj.core.api.Assertions.assertThat;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
 
+import org.junit.Before;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
-import org.apache.geode.internal.cache.InitialImageOperation.RequestFilterInfoMessage;
+import org.apache.geode.distributed.internal.ClusterDistributionManager;
+import org.apache.geode.distributed.internal.InternalDistributedSystem;
+import org.apache.geode.internal.cache.TXCommitMessage.RegionCommit;
 import org.apache.geode.test.junit.categories.UnitTest;
 
 @Category(UnitTest.class)
-public class RequestFilterInfoMessageTest {
+public class RegionCommitTest {
+
+  private ClusterDistributionManager dm;
+  private String path;
+  private LocalRegion region;
+  private TXCommitMessage txCommitMessage;
+
+  @Before
+  public void setUp() {
+    path = "path";
+
+    InternalCache cache = mock(InternalCache.class);
+
+    dm = mock(ClusterDistributionManager.class);
+    region = mock(LocalRegion.class);
+    txCommitMessage = mock(TXCommitMessage.class);
+
+    when(dm.getCache()).thenReturn(cache);
+    when(cache.getRegionByPath(path)).thenReturn(region);
+    when(dm.getSystem()).thenReturn(mock(InternalDistributedSystem.class));
+  }
 
   @Test
-  public void shouldBeMockable() throws Exception {
-    RequestFilterInfoMessage mockRequestFilterInfoMessage = mock(RequestFilterInfoMessage.class);
-    when(mockRequestFilterInfoMessage.getProcessorType()).thenReturn(1);
-    assertThat(mockRequestFilterInfoMessage.getProcessorType()).isEqualTo(1);
+  public void getsRegionFromCacheFromDM() {
+    RegionCommit regionCommit = new RegionCommit(txCommitMessage);
+    assertThat(regionCommit.getRegionByPath(dm, path)).isEqualTo(region);
   }
 }
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/RequestFilterInfoMessageTest.java b/geode-core/src/test/java/org/apache/geode/internal/cache/RequestFilterInfoMessageTest.java
index 062b0f0..31238af 100644
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/RequestFilterInfoMessageTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/RequestFilterInfoMessageTest.java
@@ -16,21 +16,51 @@ package org.apache.geode.internal.cache;
 
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
 
+import org.junit.Before;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
+import org.apache.geode.distributed.internal.ClusterDistributionManager;
 import org.apache.geode.internal.cache.InitialImageOperation.RequestFilterInfoMessage;
 import org.apache.geode.test.junit.categories.UnitTest;
 
 @Category(UnitTest.class)
 public class RequestFilterInfoMessageTest {
 
+  private ClusterDistributionManager dm;
+  private InternalCache cache;
+  private String path;
+  private LocalRegion region;
+
+  @Before
+  public void setUp() {
+    path = "path";
+
+    dm = mock(ClusterDistributionManager.class);
+    cache = mock(InternalCache.class);
+    region = mock(LocalRegion.class);
+
+    when(dm.getCache()).thenReturn(cache);
+    when(cache.getRegionByPath(path)).thenReturn(region);
+  }
+
   @Test
   public void shouldBeMockable() throws Exception {
     RequestFilterInfoMessage mockRequestFilterInfoMessage = mock(RequestFilterInfoMessage.class);
     when(mockRequestFilterInfoMessage.getProcessorType()).thenReturn(1);
     assertThat(mockRequestFilterInfoMessage.getProcessorType()).isEqualTo(1);
   }
+
+  @Test
+  public void getsRegionFromCacheFromDM() {
+    RequestFilterInfoMessage message = new RequestFilterInfoMessage();
+    message.regionPath = path;
+    message.process(dm);
+    verify(dm, times(1)).getCache();
+    verify(cache, times(1)).getRegionByPath(path);
+  }
 }
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/RequestFilterInfoMessageTest.java b/geode-core/src/test/java/org/apache/geode/internal/cache/TXRegionLockRequestImplTest.java
similarity index 50%
copy from geode-core/src/test/java/org/apache/geode/internal/cache/RequestFilterInfoMessageTest.java
copy to geode-core/src/test/java/org/apache/geode/internal/cache/TXRegionLockRequestImplTest.java
index 062b0f0..19cb5b8 100644
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/RequestFilterInfoMessageTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/TXRegionLockRequestImplTest.java
@@ -12,25 +12,44 @@
  * or implied. See the License for the specific language governing permissions and limitations under
  * the License.
  */
+
 package org.apache.geode.internal.cache;
 
-import static org.assertj.core.api.Assertions.assertThat;
+import static org.assertj.core.api.Assertions.assertThatThrownBy;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.Mockito.doThrow;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
 
+import org.junit.Before;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
-import org.apache.geode.internal.cache.InitialImageOperation.RequestFilterInfoMessage;
+import org.apache.geode.CancelCriterion;
+import org.apache.geode.CancelException;
+import org.apache.geode.cache.CacheClosedException;
 import org.apache.geode.test.junit.categories.UnitTest;
 
 @Category(UnitTest.class)
-public class RequestFilterInfoMessageTest {
+public class TXRegionLockRequestImplTest {
+
+  private InternalCache cache;
+  private LocalRegion region;
+  private CancelCriterion cancelCriterion;
+
+  @Before
+  public void setUp() {
+    cache = mock(InternalCache.class);
+    region = mock(LocalRegion.class);
+    cancelCriterion = mock(CancelCriterion.class);
+
+    when(cache.getCancelCriterion()).thenReturn(cancelCriterion);
+    doThrow(new CacheClosedException()).when(cancelCriterion).checkCancelInProgress(any());
+  }
 
   @Test
-  public void shouldBeMockable() throws Exception {
-    RequestFilterInfoMessage mockRequestFilterInfoMessage = mock(RequestFilterInfoMessage.class);
-    when(mockRequestFilterInfoMessage.getProcessorType()).thenReturn(1);
-    assertThat(mockRequestFilterInfoMessage.getProcessorType()).isEqualTo(1);
+  public void getKeysThrowsCancelExceptionIfCacheIsClosed() {
+    TXRegionLockRequestImpl txRegionLockRequest = new TXRegionLockRequestImpl(cache, region);
+    assertThatThrownBy(() -> txRegionLockRequest.getKeys()).isInstanceOf(CancelException.class);
   }
 }
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/TXReservationMgrJUnitTest.java b/geode-core/src/test/java/org/apache/geode/internal/cache/TXReservationMgrJUnitTest.java
index 6a9072a..90d1574 100644
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/TXReservationMgrJUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/TXReservationMgrJUnitTest.java
@@ -70,7 +70,7 @@ public class TXReservationMgrJUnitTest {
       do {
         try {
           IdentityArrayList l = new IdentityArrayList(1);
-          TXRegionLockRequestImpl lr = new TXRegionLockRequestImpl(this.r);
+          TXRegionLockRequestImpl lr = new TXRegionLockRequestImpl(this.r.getCache(), this.r);
           lr.addEntryKeys(Collections.singleton(key));
           l.add(lr);
           mgr.makeReservation(l);
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/TXStateProxyImplJUnitTest.java b/geode-core/src/test/java/org/apache/geode/internal/cache/TXStateProxyImplTest.java
similarity index 61%
rename from geode-core/src/test/java/org/apache/geode/internal/cache/TXStateProxyImplJUnitTest.java
rename to geode-core/src/test/java/org/apache/geode/internal/cache/TXStateProxyImplTest.java
index a6ddb7c..7d0cfec 100644
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/TXStateProxyImplJUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/TXStateProxyImplTest.java
@@ -12,13 +12,12 @@
  * or implied. See the License for the specific language governing permissions and limitations under
  * the License.
  */
-
 package org.apache.geode.internal.cache;
 
-
-import static org.junit.Assert.*;
+import static org.assertj.core.api.Assertions.*;
 import static org.mockito.Mockito.*;
 
+import org.junit.Before;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
@@ -28,22 +27,36 @@ import org.apache.geode.internal.cache.region.entry.RegionEntryFactoryBuilder;
 import org.apache.geode.test.junit.categories.UnitTest;
 
 @Category(UnitTest.class)
-public class TXStateProxyImplJUnitTest {
+public class TXStateProxyImplTest {
+
+  private InternalCache cache;
+  private LocalRegion region;
+  String key = "testkey";
+  TXStateProxyImpl tx;
+  LocalRegionDataView view;
+  private TXId txId;
+  private TXManagerImpl txManager;
+
+  @Before
+  public void setUp() {
+    cache = mock(InternalCache.class);
+    region = mock(LocalRegion.class);
+    txId = new TXId(mock(InternalDistributedMember.class), 1);
+    txManager = mock(TXManagerImpl.class);
+    view = mock(LocalRegionDataView.class);
+  }
+
   @Test
-  public void testGetKeyForIterator() {
-    RegionEntryFactory factory = new RegionEntryFactoryBuilder().getRegionEntryFactoryOrNull(false,
-        false, false, false, false);
-    LocalRegion region = mock(LocalRegion.class);
-    String key = "testkey";
-    RegionEntry re = factory.createEntry(region, key, null);
-    TXId txId = new TXId(mock(InternalDistributedMember.class), 1);
-    TXStateProxyImpl tx = new TXStateProxyImpl(mock(TXManagerImpl.class), txId, false);
-    LocalRegionDataView view = mock(LocalRegionDataView.class);
-    boolean allowTombstones = false;
-    boolean rememberReads = true;
+  public void getKeyForIteratorReturnsKey() {
+    RegionEntryFactory regionEntryFactory = new RegionEntryFactoryBuilder()
+        .getRegionEntryFactoryOrNull(false, false, false, false, false);
+    RegionEntry regionEntry = regionEntryFactory.createEntry(region, key, null);
 
     KeyInfo stringKeyInfo = new KeyInfo(key, null, null);
-    KeyInfo regionEntryKeyInfo = new KeyInfo(re, null, null);
+    KeyInfo regionEntryKeyInfo = new KeyInfo(regionEntry, null, null);
+
+    boolean allowTombstones = false;
+    boolean rememberReads = true;
 
     when(region.getSharedDataView()).thenReturn(view);
     when(view.getEntry(stringKeyInfo, region, allowTombstones)).thenReturn(mock(NonTXEntry.class));
@@ -52,10 +65,18 @@ public class TXStateProxyImplJUnitTest {
     when(view.getKeyForIterator(regionEntryKeyInfo, region, rememberReads, allowTombstones))
         .thenCallRealMethod();
 
+    TXStateProxyImpl tx = new TXStateProxyImpl(cache, txManager, txId, false);
+
     Object key1 = tx.getKeyForIterator(regionEntryKeyInfo, region, rememberReads, allowTombstones);
-    assertTrue(key1.equals(key));
+    assertThat(key1.equals(key)).isTrue();
+
     Object key2 = tx.getKeyForIterator(stringKeyInfo, region, rememberReads, allowTombstones);
-    assertTrue(key2.equals(key));
+    assertThat(key2.equals(key)).isTrue();
   }
 
+  @Test
+  public void getCacheReturnsInjectedCache() {
+    TXStateProxyImpl tx = new TXStateProxyImpl(cache, txManager, txId, false);
+    assertThat(tx.getCache()).isSameAs(cache);
+  }
 }
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/TXSynchronizationRunnableTest.java b/geode-core/src/test/java/org/apache/geode/internal/cache/TXSynchronizationRunnableTest.java
new file mode 100644
index 0000000..a6ba2f5
--- /dev/null
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/TXSynchronizationRunnableTest.java
@@ -0,0 +1,64 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more contributor license
+ * agreements. See the NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the License. You may obtain a
+ * copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package org.apache.geode.internal.cache;
+
+import static org.assertj.core.api.Assertions.assertThatThrownBy;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.Mockito.doThrow;
+import static org.mockito.Mockito.mock;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import org.apache.geode.CancelCriterion;
+import org.apache.geode.cache.CacheClosedException;
+import org.apache.geode.internal.cache.tier.sockets.CommBufferPool;
+import org.apache.geode.test.junit.categories.UnitTest;
+
+@Category(UnitTest.class)
+public class TXSynchronizationRunnableTest {
+
+  private CancelCriterion cancelCriterion;
+  private CommBufferPool commBufferPool;
+  private Runnable beforeCompletion;
+  private CacheClosedException exception;
+
+
+  @Before
+  public void setUp() {
+    exception = new CacheClosedException();
+
+    cancelCriterion = mock(CancelCriterion.class);
+    commBufferPool = mock(CommBufferPool.class);
+    beforeCompletion = mock(Runnable.class);
+
+    doThrow(exception).when(cancelCriterion).checkCancelInProgress(any());
+  }
+
+  @Test
+  public void test() {
+    TXSynchronizationRunnable runnable =
+        new TXSynchronizationRunnable(cancelCriterion, commBufferPool, beforeCompletion);
+    assertThatThrownBy(() -> runnable.waitForFirstExecution()).isSameAs(exception);
+  }
+
+  @Test
+  public void test1() {
+    TXSynchronizationRunnable runnable =
+        new TXSynchronizationRunnable(cancelCriterion, commBufferPool, beforeCompletion);
+    assertThatThrownBy(() -> runnable.runSecondRunnable(mock(Runnable.class))).isSameAs(exception);
+  }
+}
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/eviction/OffHeapEvictionDUnitTest.java b/geode-core/src/test/java/org/apache/geode/internal/cache/eviction/OffHeapEvictionDUnitTest.java
index 0e2fae5..ea84592 100644
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/eviction/OffHeapEvictionDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/eviction/OffHeapEvictionDUnitTest.java
@@ -55,7 +55,7 @@ public class OffHeapEvictionDUnitTest extends EvictionDUnitTest {
       @Override
       public void run() {
         if (hasCache()) {
-          OffHeapTestUtil.checkOrphans();
+          OffHeapTestUtil.checkOrphans(getCache());
         }
       }
     };
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/eviction/OffHeapEvictionStatsDUnitTest.java b/geode-core/src/test/java/org/apache/geode/internal/cache/eviction/OffHeapEvictionStatsDUnitTest.java
index 3ff3164..278c774 100644
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/eviction/OffHeapEvictionStatsDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/eviction/OffHeapEvictionStatsDUnitTest.java
@@ -46,7 +46,7 @@ public class OffHeapEvictionStatsDUnitTest extends EvictionStatsDUnitTest {
       @Override
       public void run() {
         if (hasCache()) {
-          OffHeapTestUtil.checkOrphans();
+          OffHeapTestUtil.checkOrphans(getCache());
         }
       }
     };
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/partitioned/PartitionMessageTest.java b/geode-core/src/test/java/org/apache/geode/internal/cache/partitioned/PartitionMessageTest.java
index 7ee108f..cfdb368 100644
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/partitioned/PartitionMessageTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/partitioned/PartitionMessageTest.java
@@ -62,6 +62,7 @@ public class PartitionMessageTest {
     when(msg.getInternalCache()).thenReturn(cache);
     when(msg.getStartPartitionMessageProcessingTime(pr)).thenReturn(startTime);
     when(msg.getTXManagerImpl(cache)).thenReturn(txMgr);
+    when(dm.getCache()).thenReturn(cache);
 
     doAnswer(CALLS_REAL_METHODS).when(msg).process(dm);
   }
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/snapshot/ClientExporterTest.java b/geode-core/src/test/java/org/apache/geode/internal/cache/snapshot/ClientExporterTest.java
new file mode 100644
index 0000000..9177b71
--- /dev/null
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/snapshot/ClientExporterTest.java
@@ -0,0 +1,52 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more contributor license
+ * agreements. See the NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the License. You may obtain a
+ * copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package org.apache.geode.internal.cache.snapshot;
+
+
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.spy;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import org.apache.geode.cache.Cache;
+import org.apache.geode.cache.CacheFactory;
+import org.apache.geode.cache.RegionShortcut;
+import org.apache.geode.cache.execute.FunctionContext;
+import org.apache.geode.cache.execute.ResultSender;
+import org.apache.geode.internal.cache.execute.FunctionContextImpl;
+import org.apache.geode.test.junit.categories.UnitTest;
+
+@Category(UnitTest.class)
+public class ClientExporterTest {
+
+  @Test
+  public void proxyExportFunctionGetsRequestedRegion() {
+    Cache cache = spy(new CacheFactory().set("locators", "").set("mcast-port", "0").create());
+    cache.createRegionFactory(RegionShortcut.PARTITION).create("testRegion");
+    ResultSender resultSender = mock(ResultSender.class);
+    ClientExporter.ClientArgs<String, String> args = mock(ClientExporter.ClientArgs.class);
+    when(args.isPRSingleHop()).thenReturn(true);
+    when(args.getRegion()).thenReturn("testRegion");
+    FunctionContext context = new FunctionContextImpl(cache, "id", args, resultSender);
+
+    new ClientExporter.ProxyExportFunction<String, String>().execute(context);
+    verify(cache).getRegion(any());
+    cache.close();
+  }
+}
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/snapshot/GFSnapshotJUnitPerformanceTest.java b/geode-core/src/test/java/org/apache/geode/internal/cache/snapshot/GFSnapshotJUnitPerformanceTest.java
index d0151dd..36000b2 100644
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/snapshot/GFSnapshotJUnitPerformanceTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/snapshot/GFSnapshotJUnitPerformanceTest.java
@@ -101,7 +101,7 @@ public class GFSnapshotJUnitPerformanceTest {
       long start = System.currentTimeMillis();
       int count = 0;
 
-      GFSnapshotImporter in = new GFSnapshotImporter(f);
+      GFSnapshotImporter in = new GFSnapshotImporter(f, null);
 
       SnapshotRecord entry;
       while ((entry = in.readSnapshotRecord()) != null) {
@@ -128,7 +128,7 @@ public class GFSnapshotJUnitPerformanceTest {
       final SnapshotWriter writer = GFSnapshot.create(tmp, "test");
 
       long start = System.currentTimeMillis();
-      SnapshotIterator<Integer, String> iter = GFSnapshot.read(f);
+      SnapshotIterator<Integer, String> iter = GFSnapshot.read(f, null);
       try {
         while (iter.hasNext()) {
           Entry<Integer, String> entry = iter.next();
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/ForceInvalidateOffHeapEvictionDUnitTest.java b/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/ForceInvalidateOffHeapEvictionDUnitTest.java
index 8e0209d..6183be8 100644
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/ForceInvalidateOffHeapEvictionDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/ForceInvalidateOffHeapEvictionDUnitTest.java
@@ -45,7 +45,7 @@ public class ForceInvalidateOffHeapEvictionDUnitTest extends ForceInvalidateEvic
       @Override
       public void run() {
         if (hasCache()) {
-          OffHeapTestUtil.checkOrphans();
+          OffHeapTestUtil.checkOrphans(getCache());
         }
       }
     };
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/command/TXFailoverCommandTest.java b/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/command/TXFailoverCommandTest.java
index 654be90..c458ca5 100644
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/command/TXFailoverCommandTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/command/TXFailoverCommandTest.java
@@ -14,22 +14,19 @@
  */
 package org.apache.geode.internal.cache.tier.sockets.command;
 
-import static org.junit.Assert.*;
-import static org.mockito.Mockito.*;
-
-import java.io.IOException;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.spy;
+import static org.mockito.Mockito.when;
 
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
-import org.junit.runner.RunWith;
-import org.powermock.api.mockito.PowerMockito;
-import org.powermock.core.classloader.annotations.PowerMockIgnore;
-import org.powermock.core.classloader.annotations.PrepareForTest;
-import org.powermock.modules.junit4.PowerMockRunner;
 
-import org.apache.geode.distributed.DistributedSystem;
+import org.apache.geode.CancelCriterion;
+import org.apache.geode.distributed.internal.InternalDistributedSystem;
 import org.apache.geode.distributed.internal.membership.InternalDistributedMember;
-import org.apache.geode.internal.cache.FindRemoteTXMessage;
 import org.apache.geode.internal.cache.FindRemoteTXMessage.FindRemoteTXMessageReplyProcessor;
 import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.internal.cache.TXId;
@@ -38,46 +35,45 @@ import org.apache.geode.internal.cache.TXStateProxyImpl;
 import org.apache.geode.internal.cache.tier.sockets.ClientProxyMembershipID;
 import org.apache.geode.internal.cache.tier.sockets.Message;
 import org.apache.geode.internal.cache.tier.sockets.ServerConnection;
-import org.apache.geode.test.fake.Fakes;
 import org.apache.geode.test.junit.categories.UnitTest;
 
-
 @Category(UnitTest.class)
-@RunWith(PowerMockRunner.class)
-@PowerMockIgnore("*.UnitTest")
-@PrepareForTest({FindRemoteTXMessage.class})
 public class TXFailoverCommandTest {
+
   @Test
-  public void testTXFailoverSettingTargetNode()
-      throws ClassNotFoundException, IOException, InterruptedException {
-    TXFailoverCommand cmd = mock(TXFailoverCommand.class);
-    Message msg = mock(Message.class);
-    ServerConnection serverConnection = mock(ServerConnection.class);
+  public void testTXFailoverSettingTargetNode() throws Exception {
     ClientProxyMembershipID clientProxyMembershipID = mock(ClientProxyMembershipID.class);
+    FindRemoteTXMessageReplyProcessor processor = mock(FindRemoteTXMessageReplyProcessor.class);
+    InternalCache cache = mock(InternalCache.class);
     InternalDistributedMember client = mock(InternalDistributedMember.class);
-    TXManagerImpl txMgr = mock(TXManagerImpl.class);
-    InternalCache cache = Fakes.cache();
+    InternalDistributedMember host = mock(InternalDistributedMember.class);
+    InternalDistributedSystem system = mock(InternalDistributedSystem.class);
+    Message message = mock(Message.class);
+    ServerConnection serverConnection = mock(ServerConnection.class);
+    TXManagerImpl txManager = mock(TXManagerImpl.class);
+
     int uniqueId = 1;
     TXId txId = new TXId(client, uniqueId);
-    TXStateProxyImpl proxy = new TXStateProxyImpl(txMgr, txId, null);
-    FindRemoteTXMessageReplyProcessor processor = mock(FindRemoteTXMessageReplyProcessor.class);
-    InternalDistributedMember host = mock(InternalDistributedMember.class);
+    TXStateProxyImpl proxy = new TXStateProxyImpl(cache, txManager, txId, null);
 
-    doCallRealMethod().when(cmd).cmdExecute(msg, serverConnection, null, 1);
-    when(serverConnection.getProxyID()).thenReturn(clientProxyMembershipID);
+    when(cache.getCacheTransactionManager()).thenReturn(txManager);
+    when(cache.getCancelCriterion()).thenReturn(mock(CancelCriterion.class));
+    when(cache.getDistributedSystem()).thenReturn(system);
     when(clientProxyMembershipID.getDistributedMember()).thenReturn(client);
-    when(msg.getTransactionId()).thenReturn(uniqueId);
-    when(serverConnection.getCache()).thenReturn(cache);
-    when(cache.getCacheTransactionManager()).thenReturn(txMgr);
-    when(txMgr.getTXState()).thenReturn(proxy);
-    when(cmd.createTXId(client, uniqueId)).thenReturn(txId);
-    PowerMockito.mockStatic(FindRemoteTXMessage.class);
-    PowerMockito.when(FindRemoteTXMessage.send(cache, txId)).thenReturn(processor);
+    when(message.getTransactionId()).thenReturn(uniqueId);
     when(processor.getHostingMember()).thenReturn(host);
-    when(proxy.getCache()).thenReturn(cache);
-    when(cache.getDistributedSystem()).thenReturn(mock(DistributedSystem.class));
+    when(serverConnection.getProxyID()).thenReturn(clientProxyMembershipID);
+    when(serverConnection.getCache()).thenReturn(cache);
+    when(txManager.getTXState()).thenReturn(proxy);
+
+    when(serverConnection.getReplyMessage()).thenReturn(mock(Message.class));
+
+    TXFailoverCommand command = spy(new TXFailoverCommand());
+    doReturn(txId).when(command).createTXId(client, uniqueId);
+    doReturn(processor).when(command).sendFindRemoteTXMessage(cache, txId);
+
+    command.cmdExecute(message, serverConnection, null, 1);
 
-    cmd.cmdExecute(msg, serverConnection, null, 1);
     assertNotNull(proxy.getRealDeal(host));
     assertEquals(proxy.getTarget(), host);
   }
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/tx/ClientTXStateStubTest.java b/geode-core/src/test/java/org/apache/geode/internal/cache/tx/ClientTXStateStubTest.java
new file mode 100644
index 0000000..e6336ef
--- /dev/null
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/tx/ClientTXStateStubTest.java
@@ -0,0 +1,82 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more contributor license
+ * agreements. See the NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the License. You may obtain a
+ * copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package org.apache.geode.internal.cache.tx;
+
+import static org.assertj.core.api.Assertions.assertThatThrownBy;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.Mockito.doThrow;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.spy;
+import static org.mockito.Mockito.when;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import org.apache.geode.CancelCriterion;
+import org.apache.geode.CancelException;
+import org.apache.geode.cache.CacheClosedException;
+import org.apache.geode.cache.client.internal.InternalPool;
+import org.apache.geode.cache.client.internal.ServerRegionProxy;
+import org.apache.geode.distributed.DistributedMember;
+import org.apache.geode.distributed.internal.DistributionManager;
+import org.apache.geode.internal.cache.InternalCache;
+import org.apache.geode.internal.cache.LocalRegion;
+import org.apache.geode.internal.cache.TXId;
+import org.apache.geode.internal.cache.TXLockRequest;
+import org.apache.geode.internal.cache.TXRegionLockRequestImpl;
+import org.apache.geode.internal.cache.TXStateProxy;
+import org.apache.geode.test.junit.categories.UnitTest;
+
+@Category(UnitTest.class)
+public class ClientTXStateStubTest {
+
+  private InternalCache cache;
+  private DistributionManager dm;
+  private TXStateProxy stateProxy;
+  private DistributedMember target;
+  private LocalRegion region;
+  private ServerRegionProxy serverRegionProxy;
+  private CancelCriterion cancelCriterion;
+
+  @Before
+  public void setUp() {
+    cache = mock(InternalCache.class);
+    dm = mock(DistributionManager.class);
+    stateProxy = mock(TXStateProxy.class);
+    target = mock(DistributedMember.class);
+    region = mock(LocalRegion.class);
+    serverRegionProxy = mock(ServerRegionProxy.class);
+    cancelCriterion = mock(CancelCriterion.class);
+
+    when(region.getServerProxy()).thenReturn(serverRegionProxy);
+    when(serverRegionProxy.getPool()).thenReturn(mock(InternalPool.class));
+    when(stateProxy.getTxId()).thenReturn(mock(TXId.class));
+    when(cache.getCancelCriterion()).thenReturn(cancelCriterion);
+    doThrow(new CacheClosedException()).when(cancelCriterion).checkCancelInProgress(any());
+  }
+
+  @Test
+  public void commitThrowsCancelExceptionIfCacheIsClosed() {
+    ClientTXStateStub stub = spy(new ClientTXStateStub(cache, dm, stateProxy, target, region));
+
+    when(stub.createTXLockRequest()).thenReturn(mock(TXLockRequest.class));
+    when(stub.createTXRegionLockRequestImpl(any(), any()))
+        .thenReturn(mock(TXRegionLockRequestImpl.class));
+
+    assertThatThrownBy(() -> stub.commit()).isInstanceOf(CancelException.class);
+  }
+
+}
diff --git a/geode-core/src/test/java/org/apache/geode/internal/compression/CompressionCacheListenerOffHeapDUnitTest.java b/geode-core/src/test/java/org/apache/geode/internal/compression/CompressionCacheListenerOffHeapDUnitTest.java
index 2db5f84..ea599d0 100644
--- a/geode-core/src/test/java/org/apache/geode/internal/compression/CompressionCacheListenerOffHeapDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/compression/CompressionCacheListenerOffHeapDUnitTest.java
@@ -37,7 +37,7 @@ public class CompressionCacheListenerOffHeapDUnitTest extends CompressionCacheLi
       @Override
       public void run() {
         if (hasCache()) {
-          OffHeapTestUtil.checkOrphans();
+          OffHeapTestUtil.checkOrphans(getCache());
         }
       }
     };
diff --git a/geode-core/src/test/java/org/apache/geode/internal/compression/CompressionRegionOperationsDUnitTest.java b/geode-core/src/test/java/org/apache/geode/internal/compression/CompressionRegionOperationsDUnitTest.java
index 46c950f..fcfa62d 100644
--- a/geode-core/src/test/java/org/apache/geode/internal/compression/CompressionRegionOperationsDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/compression/CompressionRegionOperationsDUnitTest.java
@@ -113,9 +113,12 @@ public class CompressionRegionOperationsDUnitTest extends JUnit4CacheTestCase {
     putAllMap.put(KEY_2, VALUE_2);
     putAllMap.put(KEY_3, VALUE_3);
 
-    putAllMap2.put(KEY_1, CachedDeserializableFactory.create(EntryEventImpl.serialize(VALUE_1)));
-    putAllMap2.put(KEY_2, CachedDeserializableFactory.create(EntryEventImpl.serialize(VALUE_2)));
-    putAllMap2.put(KEY_3, CachedDeserializableFactory.create(EntryEventImpl.serialize(VALUE_3)));
+    putAllMap2.put(KEY_1,
+        CachedDeserializableFactory.create(EntryEventImpl.serialize(VALUE_1), null));
+    putAllMap2.put(KEY_2,
+        CachedDeserializableFactory.create(EntryEventImpl.serialize(VALUE_2), null));
+    putAllMap2.put(KEY_3,
+        CachedDeserializableFactory.create(EntryEventImpl.serialize(VALUE_3), null));
 
     putAllMap3.put(KEY_1, VALUE_1.getBytes());
     putAllMap3.put(KEY_2, VALUE_2.getBytes());
@@ -337,14 +340,14 @@ public class CompressionRegionOperationsDUnitTest extends JUnit4CacheTestCase {
       public void run() {
         Region<String, Object> region = getCache().getRegion(REGION_NAME);
         String oldValue = (String) region.put(KEY_1,
-            CachedDeserializableFactory.create(EntryEventImpl.serialize(VALUE_1)));
+            CachedDeserializableFactory.create(EntryEventImpl.serialize(VALUE_1), getCache()));
         assertNull(oldValue);
 
         oldValue = (String) region.get(KEY_1);
         assertEquals(VALUE_1, oldValue);
 
         oldValue = (String) region.put(KEY_1,
-            CachedDeserializableFactory.create(EntryEventImpl.serialize(VALUE_2)));
+            CachedDeserializableFactory.create(EntryEventImpl.serialize(VALUE_2), getCache()));
         if (null != oldValue) {
           assertEquals(VALUE_1, oldValue);
         }
@@ -353,7 +356,7 @@ public class CompressionRegionOperationsDUnitTest extends JUnit4CacheTestCase {
         assertEquals(VALUE_2, oldValue);
 
         oldValue = (String) region.putIfAbsent(KEY_1,
-            CachedDeserializableFactory.create(EntryEventImpl.serialize(VALUE_3)));
+            CachedDeserializableFactory.create(EntryEventImpl.serialize(VALUE_3), getCache()));
         assertEquals(VALUE_2, oldValue);
 
         region.putAll(putAllMap2);
diff --git a/geode-core/src/test/java/org/apache/geode/internal/compression/CompressionRegionOperationsOffHeapDUnitTest.java b/geode-core/src/test/java/org/apache/geode/internal/compression/CompressionRegionOperationsOffHeapDUnitTest.java
index 456dbbb..8af723a 100644
--- a/geode-core/src/test/java/org/apache/geode/internal/compression/CompressionRegionOperationsOffHeapDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/compression/CompressionRegionOperationsOffHeapDUnitTest.java
@@ -38,7 +38,7 @@ public class CompressionRegionOperationsOffHeapDUnitTest
       @Override
       public void run() {
         if (hasCache()) {
-          OffHeapTestUtil.checkOrphans();
+          OffHeapTestUtil.checkOrphans(getCache());
         }
       }
     };
diff --git a/geode-core/src/test/java/org/apache/geode/internal/lang/StringUtilsJUnitTest.java b/geode-core/src/test/java/org/apache/geode/internal/lang/StringUtilsJUnitTest.java
index bedb750..f324d10 100644
--- a/geode-core/src/test/java/org/apache/geode/internal/lang/StringUtilsJUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/lang/StringUtilsJUnitTest.java
@@ -117,7 +117,7 @@ public class StringUtilsJUnitTest {
     DataSerializer.writeObject(v, dos);
     dos.flush();
     byte[] valueBytes = baos.toByteArray();
-    CachedDeserializable cd = CachedDeserializableFactory.create(valueBytes);
+    CachedDeserializable cd = CachedDeserializableFactory.create(valueBytes, null);
     assertSame(valueBytes, cd.getValue());
     assertEquals("value", StringUtils.forceToString(cd));
     assertSame(valueBytes, cd.getValue());
diff --git a/geode-core/src/test/java/org/apache/geode/internal/offheap/MemoryAllocatorJUnitTest.java b/geode-core/src/test/java/org/apache/geode/internal/offheap/MemoryAllocatorJUnitTest.java
index b918fd0..17e6c40 100644
--- a/geode-core/src/test/java/org/apache/geode/internal/offheap/MemoryAllocatorJUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/offheap/MemoryAllocatorJUnitTest.java
@@ -308,7 +308,7 @@ public class MemoryAllocatorJUnitTest {
       MemoryAllocatorImpl ma =
           MemoryAllocatorImpl.createForUnitTest(new NullOutOfOffHeapMemoryListener(),
               new NullOffHeapMemoryStats(), new SlabImpl[] {slab});
-      assertEquals(Collections.emptyList(), ma.getLostChunks());
+      assertEquals(Collections.emptyList(), ma.getLostChunks(null));
     } finally {
       MemoryAllocatorImpl.freeOffHeapMemory();
     }
diff --git a/geode-core/src/test/java/org/apache/geode/internal/offheap/OffHeapHelperJUnitTest.java b/geode-core/src/test/java/org/apache/geode/internal/offheap/OffHeapHelperJUnitTest.java
index af52e59..df86028 100644
--- a/geode-core/src/test/java/org/apache/geode/internal/offheap/OffHeapHelperJUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/offheap/OffHeapHelperJUnitTest.java
@@ -156,7 +156,7 @@ public class OffHeapHelperJUnitTest extends AbstractStoredObjectTestBase {
   @Test
   public void copyAndReleaseWithNullReturnsNull() {
     Object testObject = null;
-    Object returnObject = OffHeapHelper.copyAndReleaseIfNeeded(testObject);
+    Object returnObject = OffHeapHelper.copyAndReleaseIfNeeded(testObject, null);
     assertThat(returnObject, is(equalTo(null)));
   }
 
@@ -165,7 +165,7 @@ public class OffHeapHelperJUnitTest extends AbstractStoredObjectTestBase {
     allocateOffHeapDeserialized();
     assertTrue(storedObject.retain());
     assertThat("Retained chunk ref count", storedObject.getRefCount(), is(2));
-    OffHeapHelper.copyAndReleaseIfNeeded(storedObject);
+    OffHeapHelper.copyAndReleaseIfNeeded(storedObject, null);
     assertThat("Chunk ref count decreases", storedObject.getRefCount(), is(1));
   }
 
@@ -174,7 +174,7 @@ public class OffHeapHelperJUnitTest extends AbstractStoredObjectTestBase {
     allocateOffHeapDeserialized();
     // assertTrue(storedObject.retain());
     assertThat("Retained chunk ref count", storedObject.getRefCount(), is(1));
-    OffHeapHelper.copyAndReleaseIfNeeded(storedObject);
+    OffHeapHelper.copyAndReleaseIfNeeded(storedObject, null);
     assertThat("Chunk ref count decreases", storedObject.getRefCount(), is(0));
   }
 
@@ -182,7 +182,7 @@ public class OffHeapHelperJUnitTest extends AbstractStoredObjectTestBase {
   public void copyAndReleaseWithDeserializedReturnsValueOfOriginal() {
     allocateOffHeapDeserialized();
     assertTrue(storedObject.retain());
-    Object returnObject = OffHeapHelper.copyAndReleaseIfNeeded(storedObject);
+    Object returnObject = OffHeapHelper.copyAndReleaseIfNeeded(storedObject, null);
     assertThat(returnObject, is(equalTo(deserializedRegionEntryValue)));
   }
 
@@ -191,7 +191,7 @@ public class OffHeapHelperJUnitTest extends AbstractStoredObjectTestBase {
     allocateOffHeapSerialized();
     assertTrue(storedObject.retain());
     Object returnObject =
-        ((VMCachedDeserializable) OffHeapHelper.copyAndReleaseIfNeeded(storedObject))
+        ((VMCachedDeserializable) OffHeapHelper.copyAndReleaseIfNeeded(storedObject, null))
             .getSerializedValue();
     assertThat(returnObject, is(equalTo(serializedRegionEntryValue)));
   }
@@ -199,36 +199,36 @@ public class OffHeapHelperJUnitTest extends AbstractStoredObjectTestBase {
   @Test
   public void copyAndReleaseNonStoredObjectReturnsOriginal() {
     Object testObject = getValue();
-    Object returnObject = OffHeapHelper.copyAndReleaseIfNeeded(testObject);
+    Object returnObject = OffHeapHelper.copyAndReleaseIfNeeded(testObject, null);
     assertThat(returnObject, is(testObject));
   }
 
   @Test
   public void copyIfNeededWithNullReturnsNull() {
     Object testObject = null;
-    Object returnObject = OffHeapHelper.copyAndReleaseIfNeeded(testObject);
+    Object returnObject = OffHeapHelper.copyAndReleaseIfNeeded(testObject, null);
     assertThat(returnObject, is(equalTo(null)));
   }
 
   @Test
   public void copyIfNeededNonOffHeapReturnsOriginal() {
     Object testObject = getValue();
-    Object returnObject = OffHeapHelper.copyIfNeeded(testObject);
+    Object returnObject = OffHeapHelper.copyIfNeeded(testObject, null);
     assertThat(returnObject, is(testObject));
   }
 
   @Test
   public void copyIfNeededOffHeapSerializedReturnsValueOfOriginal() {
     allocateOffHeapSerialized();
-    Object returnObject =
-        ((VMCachedDeserializable) OffHeapHelper.copyIfNeeded(storedObject)).getSerializedValue();
+    Object returnObject = ((VMCachedDeserializable) OffHeapHelper.copyIfNeeded(storedObject, null))
+        .getSerializedValue();
     assertThat(returnObject, is(equalTo(serializedRegionEntryValue)));
   }
 
   @Test
   public void copyIfNeededOffHeapDeserializedReturnsOriginal() {
     allocateOffHeapDeserialized();
-    Object returnObject = OffHeapHelper.copyIfNeeded(storedObject);
+    Object returnObject = OffHeapHelper.copyIfNeeded(storedObject, null);
     assertThat(returnObject, is(equalTo(deserializedRegionEntryValue)));
   }
 
@@ -236,7 +236,7 @@ public class OffHeapHelperJUnitTest extends AbstractStoredObjectTestBase {
   public void copyIfNeededWithOffHeapDeserializedObjDoesNotRelease() {
     allocateOffHeapDeserialized();
     int initialRefCountOfObject = storedObject.getRefCount();
-    OffHeapHelper.copyIfNeeded(storedObject);
+    OffHeapHelper.copyIfNeeded(storedObject, null);
     assertThat("Ref count after copy", storedObject.getRefCount(), is(initialRefCountOfObject));
   }
 
@@ -244,7 +244,7 @@ public class OffHeapHelperJUnitTest extends AbstractStoredObjectTestBase {
   public void copyIfNeededWithOffHeapSerializedObjDoesNotRelease() {
     allocateOffHeapSerialized();
     int initialRefCountOfObject = storedObject.getRefCount();
-    OffHeapHelper.copyIfNeeded(storedObject);
+    OffHeapHelper.copyIfNeeded(storedObject, null);
     assertThat("Ref count after copy", storedObject.getRefCount(), is(initialRefCountOfObject));
   }
 
diff --git a/geode-core/src/test/java/org/apache/geode/internal/offheap/OffHeapRegionBase.java b/geode-core/src/test/java/org/apache/geode/internal/offheap/OffHeapRegionBase.java
index 8bc91ff..487ffa2 100644
--- a/geode-core/src/test/java/org/apache/geode/internal/offheap/OffHeapRegionBase.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/offheap/OffHeapRegionBase.java
@@ -688,7 +688,7 @@ public abstract class OffHeapRegionBase {
           .setCompressor(null).create("region1");
       assertEquals(true, r.containsKey(key));
       MemoryAllocatorImpl mai = MemoryAllocatorImpl.getAllocator();
-      List<OffHeapStoredObject> orphans = mai.getLostChunks();
+      List<OffHeapStoredObject> orphans = mai.getLostChunks(gfc);
       if (orphans.size() > 0) {
         fail("expected no orphan detected, but gets orphan size " + orphans.size());
       }
diff --git a/geode-core/src/test/java/org/apache/geode/internal/offheap/OutOfOffHeapMemoryDUnitTest.java b/geode-core/src/test/java/org/apache/geode/internal/offheap/OutOfOffHeapMemoryDUnitTest.java
index 10ac7e0..cc2b970 100755
--- a/geode-core/src/test/java/org/apache/geode/internal/offheap/OutOfOffHeapMemoryDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/offheap/OutOfOffHeapMemoryDUnitTest.java
@@ -75,7 +75,7 @@ public class OutOfOffHeapMemoryDUnitTest extends JUnit4CacheTestCase {
       @Override
       public void run() {
         if (hasCache()) {
-          OffHeapTestUtil.checkOrphans();
+          OffHeapTestUtil.checkOrphans(getCache());
         }
       }
     };
diff --git a/geode-core/src/test/resources/org/apache/geode/codeAnalysis/sanctionedDataSerializables.txt b/geode-core/src/test/resources/org/apache/geode/codeAnalysis/sanctionedDataSerializables.txt
index 5194f46..1c5a36d 100644
--- a/geode-core/src/test/resources/org/apache/geode/codeAnalysis/sanctionedDataSerializables.txt
+++ b/geode-core/src/test/resources/org/apache/geode/codeAnalysis/sanctionedDataSerializables.txt
@@ -867,20 +867,20 @@ fromData,113,2a2bb700692bb9006a01003d2a1cb6001e2a1cb7006b9900162abb006c59b7006db
 toData,101,2a2bb700612b2ab6001db9006202002ab40028c6000b2ab400282bb800632ab4000eb9002e01009a000c2a2ab4000e2bb700642ab4000fb9002e01009a000c2a2ab4000f2bb700642ab400192bb800652ab40018b9003201009a000b2ab400182bb80065b1
 
 org/apache/geode/internal/cache/CacheServerAdvisor$CacheServerProfile,2
-fromData,53,2a2bb700112a2bb80012b500042a2bb900130100b500062abb001459b70015b500052ab400052bb800162a2bb900170100b60018b1
-toData,42,2a2bb7000b2ab400042bb8000c2b2ab40006b9000d02002ab400052bb8000e2b2ab6000fb900100300b1
+fromData,53,2a2bb700122a2bb80013b500042a2bb900140100b500062abb001559b70016b500052ab400052bb800172a2bb900180100b60019b1
+toData,42,2a2bb7000c2ab400042bb8000d2b2ab40006b9000e02002ab400052bb8000f2b2ab60010b900110300b1
 
 org/apache/geode/internal/cache/ClientRegionEventImpl,2
 fromData,14,2a2bb700142a2bb80015b60003b1
 toData,14,2a2bb700122ab6000d2bb80013b1
 
 org/apache/geode/internal/cache/CloseCacheMessage,2
-fromData,16,2a2bb700172a2bb900180100b50002b1
-toData,16,2a2bb700192b2ab40002b9001a0200b1
+fromData,16,2a2bb700182a2bb900190100b50002b1
+toData,16,2a2bb7001a2b2ab40002b9001b0200b1
 
 org/apache/geode/internal/cache/ControllerAdvisor$ControllerProfile,2
-fromData,6,2a2bb70007b1
-toData,6,2a2bb70006b1
+fromData,6,2a2bb70008b1
+toData,6,2a2bb70007b1
 
 org/apache/geode/internal/cache/CreateRegionProcessor$CreateRegionMessage,2
 fromData,45,2a2bb7009d2a2bb8009eb500082a2bb8009fc00053b500412a2bb900a00100b500032a2bb900a10100b50063b1
@@ -955,15 +955,15 @@ fromData,268,2bb9002201003d1c077e07a0000704a70004033e1c10207e1020a0000704a700040
 toData,289,033d033e2ab600089e003d1c07803d043e2ab6000b3a041904b9000c01009900271904b9000d0100c0000a3a051905c600131905c1001199000e1c1020803da70006a7ffd5b80012b20013b900140200990015b80012b2001312152a1cb80016b9001705002b1cb9001802001d9900b32ab60008852bb80019bb001a592ab60008b7001b3a040336052ab6000b3a061906b9000c010099008a1906b9000d0100c0000a3a071907c7000d2b03b900180200a7006c1907b6001c3a081908c700132b04b90018020019072bb8001da7005019041908b6001e360915099a00242b05b90018020084050115053609190419081 [...]
 
 org/apache/geode/internal/cache/DistributedPutAllOperation$PutAllEntryData,1
-toData,229,2ab4000a4d2ab4000c4e2c2bb8003d2dc1003e9a00072dc700182b03b9003f02002dc0003ec0003e2bb80040a700312dc1004199001e2dc000413a042b04b9003f02001904b9004201002bb80040a7000f2b04b9003f02002d2bb800432b2ab40012b40044b9003f02002ab4000636042ab40026c6000a150407809136042ab40017c6001d15041008809136042ab40017c1004599000b150410208091360415041080809136042b1504b9003f02002ab40026c6000b2ab400262bb8003d2ab40017c6000b2ab400172bb800462ab6002899000b2ab400142bb800462ab400082bb80047b1
+toData,229,2ab4000a4d2ab4000c4e2c2bb8003e2dc1003f9a00072dc700182b03b9004002002dc0003fc0003f2bb80041a700312dc1004299001e2dc000423a042b04b9004002001904b9004301002bb80041a7000f2b04b9004002002d2bb800442b2ab40012b40045b9004002002ab4000636042ab40027c6000a150407809136042ab40017c6001d15041008809136042ab40017c1004699000b150410208091360415041080809136042b1504b9004002002ab40027c6000b2ab400272bb8003e2ab40017c6000b2ab400172bb800472ab6002999000b2ab400142bb800472ab400082bb80048b1
 
 org/apache/geode/internal/cache/DistributedPutAllOperation$PutAllMessage,2
 fromData,197,2a2bb7003a2a2bb8003bc0003cb500052a2bb8003d88b500152a2ab40015bd003eb500062ab400159e00722bb8003f4dbb004059b700414e03360415042ab40015a200202ab400061504bb003e592b2ab4000515042c2db7004253840401a7ffdd2bb9004301003604150499002f2bb800443a0503360615062ab40015a2001d2ab4000615063219051506b60045c00046b5002c840601a7ffe02ab400471140007e99000e2a2bb8003bc00048b5000b2a2ab400471180007e99000704a7000403b5001ab1
 toData,165,2a2bb700492ab400052bb8004a2ab40015852bb8004b2ab400159e007bbb004c592ab40015b7004d4d033e03360415042ab40015a200511d9a00122ab40006150432b4002cc60005043e2ab40006150432b4002c3a052c1905b6004e572ab4000615043201b5002c2ab400061504322bb6004f2ab400061504321905b5002c840401a7ffac2b1db9005002001d9900082c2bb800512ab4000bc6000b2ab4000b2bb8004ab1
 
 org/apache/geode/internal/cache/DistributedRegionFunctionStreamingMessage,2
-fromData,171,2a2bb700642bb9006501003d1c047e9900142a2bb900660100b500092ab40009b800671c077e99000d2a2bb900660100b500061c057e99000e2a2bb80068c00069b500072bb800684e2dc1006a9900252a03b5000e2a2dc0006ab8006bb500082ab40008c7001b2a2dc0006ab5004fa700102a2dc0006cb500082a04b5000e2a2bb80068c0006db5000a2a2bb8006eb5000c2a2bb8006fb5000b2a1c10407e99000704a7000403b5000db1
-toData,173,2a2bb70071033d2ab400099900081c0480933d2ab40006029f00081c0780933d2ab40007c600081c0580933d2ab4000d9900091c104080933d2b1cb9007202002ab4000999000d2b2ab40009b9007302002ab40006029f000d2b2ab40006b9007302002ab40007c6000b2ab400072bb800742ab4000e99000e2ab400082bb80074a700102ab40008b9005a01002bb800742ab4000a2bb800742ab4000cc000752bb800762ab4000b2bb80077b1
+fromData,171,2a2bb700652bb9006601003d1c047e9900142a2bb900670100b500092ab40009b800681c077e99000d2a2bb900670100b500061c057e99000e2a2bb80069c0006ab500072bb800694e2dc1006b9900252a03b5000e2a2dc0006bb8006cb500082ab40008c7001b2a2dc0006bb50050a700102a2dc0006db500082a04b5000e2a2bb80069c0006eb5000a2a2bb8006fb5000c2a2bb80070b5000b2a1c10407e99000704a7000403b5000db1
+toData,173,2a2bb70072033d2ab400099900081c0480933d2ab40006029f00081c0780933d2ab40007c600081c0580933d2ab4000d9900091c104080933d2b1cb9007302002ab4000999000d2b2ab40009b9007402002ab40006029f000d2b2ab40006b9007402002ab40007c6000b2ab400072bb800752ab4000e99000e2ab400082bb80075a700102ab40008b9005b01002bb800752ab4000a2bb800752ab4000cc000762bb800772ab4000b2bb80078b1
 
 org/apache/geode/internal/cache/DistributedRemoveAllOperation$RemoveAllEntryData,1
 toData,136,2ab4000a4d2c2bb800412b2ab40010b40042b9004302002ab400063e2ab40024c600081d0780913e2ab40015c600191d100880913e2ab40015c100449900091d102080913e1d108080913e2b1db9004302002ab40024c6000b2ab400242bb800412ab40015c6000b2ab400152bb800452ab6002699000b2ab400122bb800452ab400082bb80046b1
@@ -981,8 +981,8 @@ fromData,17,2a2bb80005b500022a2bb80005b50003b1
 toData,17,2ab400022bb800042ab400032bb80004b1
 
 org/apache/geode/internal/cache/EntryEventImpl,2
-fromData,216,2a2bb80016c00017b500182bb800164d2bb800164e2abb0019592c2d01b7001ab5001b2a2bb9001c0100b8001db5001e2a2bb9001f0100b500082ab4001b2bb80016b600202a2bb80016c00021b500092bb900220100990013b200239a003cbb0024591225b70026bf2bb9002201009900212a2bb80027b500282a2ab40028b500062a2ab40028b80029b50005a7000b2a2bb80016b500052bb9002201009900192a2bb80027b5002a2a2ab4002ab80029b50007a7000b2a2bb80016b500072a2bb8002bb5002c2a2bb8002db5000a2a2bb8002eb50013b1
-toData,284,2ab400182bb8014d2ab600882bb8014d2ab4001bb6017a2bb8014d2b2ab4001eb4017bb9017c02002b2ab4000811c03f7eb9017d02002ab600492bb8014d2ab400092bb8014d2b03b9017e02002ab6003f4d2cc1007f3e1d99000d2cc0007fb900ae01003e2b1db9017e02001d99003b2ab40028c6000e2ab400282bb8017fa7002e2ab40006c6000e2ab400062bb8017fa7001c2cc0007f3a041904b900bc01002bb80180a700082c2bb8014d2ab600414d2cc1007f3e1d99000d2cc0007fb900ae01003e2b1db9017e02001d9900292ab4002ac6000e2ab4002a2bb8017fa700212cc0007f3a041904b900bc01002bb [...]
+fromData,222,2a2bb80016c00017b500182bb800164d2bb800164e2abb0019592c2d01b7001ab5001b2a2bb9001c0100b8001db5001e2a2bb9001f0100b500082ab4001b2bb80016b600202a2bb80016c00021b500092bb900220100990013b200239a003fbb0024591225b70026bf2bb9002201009900242a2bb80027b500282a2ab40028b500062a2ab40028b80029b8002ab50005a7000b2a2bb80016b500052bb90022010099001c2a2bb80027b5002b2a2ab4002bb80029b8002ab50007a7000b2a2bb80016b500072a2bb8002cb5002d2a2bb8002eb5000a2a2bb8002fb50013b1
+toData,284,2ab400182bb8014f2ab600892bb8014f2ab4001bb6017c2bb8014f2b2ab4001eb4017db9017e02002b2ab4000811c03f7eb9017f02002ab6004a2bb8014f2ab400092bb8014f2b03b9018002002ab600404d2cc100803e1d99000d2cc00080b900b001003e2b1db9018002001d99003b2ab40028c6000e2ab400282bb80181a7002e2ab40006c6000e2ab400062bb80181a7001c2cc000803a041904b900be01002bb80182a700082c2bb8014f2ab600424d2cc100803e1d99000d2cc00080b900b001003e2b1db9018002001d9900292ab4002bc6000e2ab4002b2bb80181a700212cc000803a041904b900be01002bb [...]
 
 org/apache/geode/internal/cache/EntrySnapshot,2
 fromData,50,2a03b500052bb9004201003d1c9900112abb000759b70043b50004a7000e2abb000359b70044b500042ab400042bb60045b1
@@ -1051,8 +1051,8 @@ fromData,64,2a2bb700102a2bb900110100b5000b2a2bb900120100b5000c2a2bb900110100b500
 toData,90,2a2bb700182b2ab4000bb9001902002b2ab4000cb9001a02002b2ab40004b9001902002ab4000d2bb8001ba7002e4d2cc1001c99000cbb001d592cb7001ebfbb0015592ab4000db6001fb60020b700214e2d2cb60017572dbfb1
 
 org/apache/geode/internal/cache/GridAdvisor$GridProfile,2
-fromData,26,2a2bb7001e2a2bb8001fb500052a2bb80020b500062ab60007b1
-toData,22,2a2bb7001b2ab400052bb8001c2ab400062bb8001db1
+fromData,26,2a2bb7001d2a2bb8001eb500052a2bb8001fb500062ab60007b1
+toData,22,2a2bb7001a2ab400052bb8001b2ab400062bb8001cb1
 
 org/apache/geode/internal/cache/HARegion$HARegionAdvisor$HAProfile,2
 fromData,47,2a2bb700032bb9000401003d2a1cb200057e99000704a7000403b500062a1cb200077e99000704a7000403b50008b1
@@ -1131,8 +1131,8 @@ fromData,30,2a2bb700122a2bb80013b500042a2bb80014b500072a2bb80015b50005b1
 toData,30,2a2bb700162ab400042bb800172ab400072bb800182ab400052bb80019b1
 
 org/apache/geode/internal/cache/MemberFunctionStreamingMessage,2
-fromData,163,2a2bb700522bb9005301003d1c047e9900142a2bb900540100b500082ab40008b800551c077e99000d2a2bb900540100b500051c057e99000e2a2bb80056c00057b500062bb800564e2dc1002b9900252a03b5000a2a2dc0002bb80058b500072ab40007c7001b2a2dc0002bb5001ba700102a2dc00059b500072a04b5000a2a2bb80056b500092a2bb80056c0005ab500102a1c10407e99000704a7000403b5000bb1
-toData,162,2a2bb7005c033d2ab400089900081c0480933d2ab40005029f00081c0780933d2ab40006c600081c0580933d2ab4000b9900091c104080933d2b1cb9005d02002ab4000899000d2b2ab40008b9005e02002ab40005029f000d2b2ab40005b9005e02002ab40006c6000b2ab400062bb8005f2ab4000a99000e2ab400072bb8005fa700102ab40007b9002001002bb8005f2ab400092bb8005f2ab400102bb8005fb1
+fromData,163,2a2bb700532bb9005401003d1c047e9900142a2bb900550100b500082ab40008b800561c077e99000d2a2bb900550100b500051c057e99000e2a2bb80057c00058b500062bb800574e2dc1002b9900252a03b5000a2a2dc0002bb80059b500072ab40007c7001b2a2dc0002bb5001ba700102a2dc0005ab500072a04b5000a2a2bb80057b500092a2bb80057c0005bb500102a1c10407e99000704a7000403b5000bb1
+toData,162,2a2bb7005d033d2ab400089900081c0480933d2ab40005029f00081c0780933d2ab40006c600081c0580933d2ab4000b9900091c104080933d2b1cb9005e02002ab4000899000d2b2ab40008b9005f02002ab40005029f000d2b2ab40005b9005f02002ab40006c6000b2ab400062bb800602ab4000a99000e2ab400072bb80060a700102ab40007b9002001002bb800602ab400092bb800602ab400102bb80060b1
 
 org/apache/geode/internal/cache/Node,2
 fromData,60,2abb001c59b7001db500052ab400052bb8001e2a2bb9001f0100b500032a2bb900200100b500042a2bb900210100b500152a2bb9001f0100b50006b1
@@ -1222,8 +1222,8 @@ fromData,52,2a2bb700242bb9002501003d1c047e99000704a70004033e1c057e99000704a70004
 toData,57,2a2bb70020033d2ab40003c600081c0480913d2ab40003c100219900081c0580913d2b1cb9002202002ab40003c6000b2ab400032bb80023b1
 
 org/apache/geode/internal/cache/RemoteOperationMessage,2
-fromData,43,2a2bb700552a2bb900560100b500572a2ab400572bb600582a2bb80059b5000a2a2bb9005a0100b50006b1
-toData,103,2a2bb7005b2ab6005c3d2b1cb9005d02002ab4000c99000d2b2ab4000cb9005e02002ab4005f99000d2b2ab4005fb9006002002ab60015029f000d2b2ab60015b9005e02002ab60016c6000b2ab600162bb800612ab4000a2bb800622b2ab40006b900630200b1
+fromData,43,2a2bb700562a2bb900570100b500582a2ab400582bb600592a2bb8005ab5000a2a2bb9005b0100b50006b1
+toData,103,2a2bb7005c2ab6005d3d2b1cb9005e02002ab4000c99000d2b2ab4000cb9005f02002ab4006099000d2b2ab40060b9006102002ab60015029f000d2b2ab60015b9005f02002ab60016c6000b2ab600162bb800622ab4000a2bb800632b2ab40006b900640200b1
 
 org/apache/geode/internal/cache/RemotePutAllMessage,2
 fromData,223,2a2bb700502a2bb80051c00052b500382a2bb80051b5003a2a2ab4005310087e99000704a7000403b500052ab4005310407e99000e2a2bb80051c00054b5004e2a2ab400531100807e99000704a7000403b500042a2bb8005588b500072a2ab40007bd0056b500062ab400079e00722bb800574dbb005859b700594e03360415042ab40007a200202ab400061504bb0056592b2ab4003815042c2db7005a53840401a7ffdd2bb9005b01003604150499002f2bb8005c3a0503360615062ab40007a2001d2ab4000615063219051506b6005dc0001fb50020840601a7ffe0b1
@@ -1298,8 +1298,8 @@ fromData,16,2a2bb7002d2a2bb9002e0100b50002b1
 toData,16,2a2bb7002b2b2ab40002b9002c0200b1
 
 org/apache/geode/internal/cache/StateFlushOperation$StateMarkerMessage,2
-fromData,62,2a2bb700552a2bb80056c00057b500182a2bb900580100b500022a2bb900580100b500032a2bb900590100b5001b2ab4001b9a000b2a2bb8005ab50008b1
-toData,59,2a2bb7004f2ab400182bb800502b2ab40002b9005102002b2ab40003b9005102002b2ab4001bb9005202002ab4001b9a000b2ab400082bb80053b1
+fromData,62,2a2bb7004f2a2bb80050c00051b500182a2bb900520100b500022a2bb900520100b500032a2bb900530100b5001b2ab4001b9a000b2a2bb80054b50008b1
+toData,59,2a2bb700492ab400182bb8004a2b2ab40002b9004b02002b2ab40003b9004b02002b2ab4001bb9004c02002ab4001b9a000b2ab400082bb8004db1
 
 org/apache/geode/internal/cache/StateFlushOperation$StateStabilizationMessage,2
 fromData,45,2a2bb700202a2bb900210100b500172a2bb80022b500192a2bb80023c00024b5001b2a2bb900250100b5001db1
@@ -1338,8 +1338,8 @@ fromData,181,2a2bb80058b5000b2a2bb80058b500202bb9005901003d1c9e009c2abb0053591cb
 toData,77,2ab40005c600152ab40005b600832ab400052bb60084a700362ab4000404a400292bb800854dbb0086591104002cb700874e2a2db700882a2db500052ab400052bb60084a700082a2bb70088b1
 
 org/apache/geode/internal/cache/TXCommitMessage$RegionCommit$FarSideEntryOp,2
-fromData,168,2a2bb80006b500072a2bb900080100b80009b5000a1c9900102a2bb9000b0100b5000ca7000d2a2bb900080100b5000c2a2bb80006b5000d2a2bb80006c0000eb500032a2bb80006c0000fb500021d99000d2a2bb900100100b500012a2bb9000b0100b500112ab4000ab600129a003a2a2bb900130100b500142ab4000ab600159a00262bb9001301003604150499000e2a2bb80006b50016a7000e2a2bb80017b80018b50016b1
-toData,187,2b2ab4000ab40019b9001a02001c9900102b2ab4000cb9001b0200a7000d2b2ab4000cb9001a02002ab4000d2bb8001c2ab400032bb8001c1d99000b2ab400022bb8001c150499000d2b2ab40001b9001d03002b2ab40011b9001b02002ab4000ab600129a00562b2ab40014b9001e02002ab4000ab600159a00422ab40016b8001f360515059a000d2ab40016c1002099000704a700040336052b1505b9001e0200150599000e2ab400162bb8001ca7000b2ab400162bb80021b1
+fromData,171,2a2bb80006b500072a2bb900080100b80009b5000a1c9900102a2bb9000b0100b5000ca7000d2a2bb900080100b5000c2a2bb80006b5000d2a2bb80006c0000eb500032a2bb80006c0000fb500021d99000d2a2bb900100100b500012a2bb9000b0100b500112ab4000ab600129a003d2a2bb900130100b500142ab4000ab600159a00292bb9001301003604150499000e2a2bb80006b50016a700112a2bb80017b80018b80019b50016b1
+toData,187,2b2ab4000ab4001ab9001b02001c9900102b2ab4000cb9001c0200a7000d2b2ab4000cb9001b02002ab4000d2bb8001d2ab400032bb8001d1d99000b2ab400022bb8001d150499000d2b2ab40001b9001e03002b2ab40011b9001c02002ab4000ab600129a00562b2ab40014b9001f02002ab4000ab600159a00422ab40016b80020360515059a000d2ab40016c1002199000704a700040336052b1505b9001f0200150599000e2ab400162bb8001da7000b2ab400162bb80022b1
 
 org/apache/geode/internal/cache/TXEntryState$DistTxThinEntryState,2
 fromData,23,2a2bb80009b6000ab500022a2bb80009b6000ab50005b1
@@ -1354,12 +1354,12 @@ fromData,9,2a2bb80009b50004b1
 toData,12,2ab40004c000072bb80008b1
 
 org/apache/geode/internal/cache/TXMessage,2
-fromData,37,2a2bb7004f2a2bb900500100b500052a2bb900500100b500032a2bb80051c00052b50002b1
-toData,34,2a2bb7004c2b2ab40005b9004d02002b2ab40003b9004d02002ab400022bb8004eb1
+fromData,37,2a2bb700502a2bb900510100b500052a2bb900510100b500032a2bb80052c00053b50002b1
+toData,34,2a2bb7004d2b2ab40005b9004e02002b2ab40003b9004e02002ab400022bb8004fb1
 
 org/apache/geode/internal/cache/TXRegionLockRequestImpl,2
-fromData,64,2a2bb8000cb500032a03b7000d4d2bb8000e3e2cc600181d9e00142a2c2ab40003b9000f0200c00010b500022a2a1d2bb70011b50004a700094e2a01b50004b1
-toData,17,2ab6001e2bb8001f2ab400042bb80020b1
+fromData,71,2a2bb8000db500042ab8000eb500022bb8000f3d2ab40002c6001b1c9e00172a2ab400022ab40004b900100200c00011b500032a2a1c2bb70012b50005a700094d2a01b50005b1
+toData,17,2ab6001f2bb800202ab400052bb80021b1
 
 org/apache/geode/internal/cache/TXRemoteCommitMessage$TXRemoteCommitReplyMessage,2
 fromData,17,2a2bb700192a2bb8001ac0001bb50004b1
@@ -1712,8 +1712,8 @@ fromData,49,2a2bb700362a2bb80037b500062a2bb900380100b80039b500082a2bb80037c0003a
 toData,43,2a2bb7003c2ab7000f2bb8003d2b2ab40008b4003eb9003f02002ab4000a2bb8003d2ab4000c2bb8003db1
 
 org/apache/geode/internal/cache/partitioned/PartitionMessage,2
-fromData,58,2a2bb7007b2a2bb9007c0100b500052a2ab400052bb6007d2a2bb9007e0100b5000e2bb8007fb20080b600819b000d2a2bb900820100b5000ab1
-toData,104,2a2bb70086033d2a1cb600873d2b1cb9008802002ab4001099000d2b2ab40010b9008902002ab40008029f000d2b2ab40008b9008902002ab40006c6000b2ab400062bb8008a2b2ab4000eb9008902002bb8008bb20080b600819b000d2b2ab4000ab9008c0200b1
+fromData,58,2a2bb7007d2a2bb9007e0100b500052a2ab400052bb6007f2a2bb900800100b5000e2bb80081b20082b600839b000d2a2bb900840100b5000ab1
+toData,104,2a2bb70088033d2a1cb600893d2b1cb9008a02002ab4001099000d2b2ab40010b9008b02002ab40008029f000d2b2ab40008b9008b02002ab40006c6000b2ab400062bb8008c2b2ab4000eb9008b02002bb8008db20082b600839b000d2b2ab4000ab9008e0200b1
 
 org/apache/geode/internal/cache/partitioned/PartitionedRegionFunctionStreamingMessage,2
 fromData,17,2a2bb7003c2a2bb8003dc0003eb50003b1
@@ -1796,8 +1796,8 @@ fromData,36,2a2bb700082a2bb900090100b500032a2bb9000a0100b500042a2bb9000a0100b500
 toData,36,2a2bb7000b2b2ab40003b9000c02002b2ab40004b9000d02002b2ab40005b9000d0200b1
 
 org/apache/geode/internal/cache/partitioned/SizeMessage,2
-fromData,14,2a2bb700362a2bb80037b50006b1
-toData,14,2a2bb700382ab400062bb80039b1
+fromData,14,2a2bb700382a2bb80039b50006b1
+toData,14,2a2bb7003a2ab400062bb8003bb1
 
 org/apache/geode/internal/cache/partitioned/SizeMessage$SizeReplyMessage,2
 fromData,17,2a2bb7001d2a2bb8001ec0001fb50003b1
@@ -1951,8 +1951,8 @@ toData,40,2ab400023d2a59b400022ab4000460b500022ab400032b1c2ab400042ab400052ab400
 toDataPre_GFE_8_0_0_0,20,2ab400029a000a2ab40003b8000c2a2bb6000db1
 
 org/apache/geode/internal/cache/tx/DistTxEntryEvent,2
-fromData,118,2a2bb80018c00019b500042bb8001a4db8001b4e2a2d2cb9001c0200c0001db500062a2bb9001e0100b8001fb500082bb800183a042bb800203a052abb002159190401011905b70022b5000c2a2bb80018b600232bb80024b6002536061506047e9900082a2bb700261506057e9900082a2bb70027b1
-toData,121,2ab400042bb800052ab40006b600072bb800052b2ab40008b40009b9000a02002ab6000b2bb800052ab4000cb6000db8000e2bb8000f2ab600102bb80005033d2ab40011c600081c0480913d2ab40013c600081c0580913d1cb800142bb800152ab40011c600082a2bb700162ab40013c600082a2bb70017b1
+fromData,99,2a2bb80019c0001ab500052a2bb8001bb500032a2bb9001c0100b8001db500092bb800194d2bb8001e4e2abb001f592c01012db70020b5000d2a2bb80019b600212bb80022b6002336041504047e9900082a2bb700241504057e9900082a2bb70025b1
+toData,121,2ab400052bb800062ab40007b600082bb800062b2ab40009b4000ab9000b02002ab6000c2bb800062ab4000db6000eb8000f2bb800102ab600112bb80006033d2ab40012c600081c0480913d2ab40014c600081c0580913d1cb800152bb800162ab40012c600082a2bb700172ab40014c600082a2bb70018b1
 
 org/apache/geode/internal/cache/versions/RVVException,2
 fromData,1,b1
@@ -1971,8 +1971,8 @@ toData,93,2ab700132ab400042bb8005e2ab40012c7000703a7000c2ab40012b9001501003d1c85
 fromData,71,2a2bb80061b500042bb80061883d2a2bb900620100b500191c9e002d2abb001a59b7001bb50012033e1d1ca2001b2bb800633a042ab400121904b90020020057840301a7ffe6b1
 
 org/apache/geode/internal/cache/versions/RegionVersionVector,2
-fromData,212,2a2a2bb600bfb500132bb900c001003d2a1c047e04a0000704a7000403b500992ab4000b2bb900c10100b600902ab4000c2bb900c10100b600902bb900c001003e03360415041da2002d2a2bb600bf3a05bb0016592bb700c23a0619061905b500882ab4001e19051906b6002b57840401a7ffd32bb900c00100360403360515051504a200442a2bb600bf3a062ab4001e1906b60039c000163a071907c6000d1907b40088c000693a062bb900c1010037082ab4001f19061608b80035b6002b57840501a7ffbb2abb0016592bb700c2b50018b1
-toData,239,2ab4001499000dbb00b25912bab700b4bf2a2ab400132bb600bb033d2ab400999900071c04803d2b1cb900bc02002b2ab4000bb6002eb900bd03002b2ab4000cb6002eb900bd03002b2ab4001eb6002cb900bc02002ab4001eb6009bb9002401004e2db90025010099002b2db900260100c000273a042a1904b900280100c000692bb600bb1904b9002901002bb800bea7ffd22b2ab4001fb6002cb900bc02002ab4001fb6009bb9002401004e2db9002501009900332db900260100c000273a042a1904b900280100c000692bb600bb2b1904b900290100c00037b60038b900bd0300a7ffca2ab400182bb800beb1
+fromData,212,2a2a2bb600c1b500122bb900c201003d2a1c047e04a0000704a7000403b500162ab4000a2bb900c30100b600152ab4000b2bb900c30100b600152bb900c201003e03360415041da2002d2a2bb600c13a05bb0021592bb700c43a0619061905b5008c2ab4001319051906b6002e57840401a7ffd32bb900c20100360403360515051504a200442a2bb600c13a062ab400131906b6003cc000213a071907c6000d1907b4008cc0006c3a062bb900c3010037082ab4001419061608b80038b6002e57840501a7ffbb2abb0021592bb700c4b50017b1
+toData,239,2ab4001f99000dbb00b45912bcb700b6bf2a2ab400122bb600bd033d2ab400169900071c04803d2b1cb900be02002b2ab4000ab60031b900bf03002b2ab4000bb60031b900bf03002b2ab40013b6002fb900be02002ab40013b6009db9002701004e2db90028010099002b2db900290100c0002a3a042a1904b9002b0100c0006c2bb600bd1904b9002c01002bb800c0a7ffd22b2ab40014b6002fb900be02002ab40014b6009db9002701004e2db9002801009900332db900290100c0002a3a042a1904b9002b0100c0006c2bb600bd2b1904b9002c0100c0003ab6003bb900bf0300a7ffca2ab400172bb800c0b1
 
 org/apache/geode/internal/cache/versions/VersionTag,2
 fromData,187,2bb9002101003db20014b20015b900160200990018b20014b2001512222ab600181cb80019b9001a0500b200232a2bb900210100b600242a2bb900250100b500101c077e9900132a2bb900260100121d7eb50006a7000f2a2bb900270100027eb500061c10107e99000d2a2bb900260100b5000a2a2bb900270100b5000d2a2bb80028b500071c047e99000c2a2a2bb60029b5000e1c057e99001e1c10087e99000e2a2ab4000eb5000fa7000c2a2a2bb60029b5000f2ab6002ab1
@@ -1989,8 +1989,8 @@ fromData,63,2a2bb700182a2bb80019b60017b500032abb00075905b7000ab500062bb9001a0100
 toData,87,2a2bb700112ab40003b800122bb800132ab40006c6003b2b2ab40006b60014b9001502002ab40006b600164d2cb9000c010099001a2cb9000d0100c0000e4e2b2db60017b900150200a7ffe3a7000a2b03b900150200b1
 
 org/apache/geode/internal/cache/wan/GatewaySenderEventImpl,2
-fromData,183,2bb9007301003d1c10119f00032a04b5002b2a2bb900740100b500282a2bb900740100b500291c1011a200232bc1007599001c2bb80076b20077a60012bb0078592bc00075b20079b7007a4c2a2bb8007bc0007cb5002a2a2bb8007db500102a2bb9007e0100b5002e2a2bb6007f2a2bb80080b500302a2bb8007bc00020b500212a2bb900810100b500132a2bb900820100b500172a2bb900740100b500092a2bb900820100b80004b500052a2bb900820100b5001bb1
-toData,133,2ab600272b1011b9006802002b2ab40028b9006902002b2ab40029b9006902002ab4002a2bb8006a2ab400102bb8006b2b2ab4002eb9006c02002a2bb6006d2ab6002f2bb8006e2ab400212bb8006a2b2ab40013b9006f02002b2ab40017b9007003002b2ab40009b9006902002b2ab40005b60071b9007003002b2ab60072b900700300b1
+fromData,183,2bb9007201003d1c10119f00032a04b5002b2a2bb900730100b500282a2bb900730100b500291c1011a200232bc1007499001c2bb80075b20076a60012bb0077592bc00074b20078b700794c2a2bb8007ac0007bb5002a2a2bb8007cb500102a2bb9007d0100b5002e2a2bb6007e2a2bb8007fb500302a2bb8007ac00020b500212a2bb900800100b500132a2bb900810100b500172a2bb900730100b500092a2bb900810100b80004b500052a2bb900810100b5001bb1
+toData,133,2ab600272b1011b9006702002b2ab40028b9006802002b2ab40029b9006802002ab4002a2bb800692ab400102bb8006a2b2ab4002eb9006b02002a2bb6006c2ab6002f2bb8006d2ab400212bb800692b2ab40013b9006e02002b2ab40017b9006f03002b2ab40009b9006802002b2ab40005b60070b9006f03002b2ab60071b9006f0300b1
 
 org/apache/geode/internal/cache/wan/GatewaySenderQueueEntrySynchronizationOperation$GatewaySenderQueueEntrySynchronizationEntry,2
 fromData,20,2a2bb80006b500022a2bb80006c00007b50001b1
@@ -2069,10 +2069,10 @@ fromData,41,2a2bb80020b500062a2bb80020b500072a2bb80020b500082a2bb80021b500092a2b
 toData,41,2ab400062bb8001d2ab400072bb8001d2ab400082bb8001d2ab400092bb8001e2ab400022bb8001fb1
 
 org/apache/geode/management/internal/cli/functions/CliFunctionResult,4
-fromData,61,2a2bb80011b500052a2bb80012b500062a2bb80013c00014b500072a2bb80015c00016c00016b500032a2bb80013c00017b500082a2bb80018b50004b1
-fromDataPre_GFE_8_0_0_0,34,2a2bb80011b500052a2bb80013c00017b500082a2bb80015c00016c00016b50003b1
-toData,49,2ab400052bb8000c2ab400062bb8000d2ab400072bb8000e2ab400032bb8000f2ab400082bb8000e2ab400042bb80010b1
-toDataPre_GFE_8_0_0_0,25,2ab400052bb8000c2ab400032bb8000f2ab400082bb8000eb1
+fromData,61,2a2bb8001cb500052a2bb8001db500062a2bb8001ec0001fb500072a2bb80020c00021c00021b500032a2bb8001ec00022b500082a2bb80023b50004b1
+fromDataPre_GFE_8_0_0_0,34,2a2bb8001cb500052a2bb8001ec00022b500082a2bb80020c00021c00021b50003b1
+toData,49,2ab400052bb800172ab400062bb800182ab400072bb800192ab400032bb8001a2ab400082bb800192ab400042bb8001bb1
+toDataPre_GFE_8_0_0_0,25,2ab400052bb800172ab400032bb8001a2ab400082bb80019b1
 
 org/apache/geode/management/internal/configuration/domain/Configuration,2
 fromData,49,2a2bb80028b500022a2bb80028b500042a2bb80028b500032a2bb80028b500052a2bb80029b500082a2bb8002ab5000bb1
@@ -2083,10 +2083,10 @@ fromData,31,2a2bb80019b6001ab500022a2bb8001bb500032a2bb8001cc0001db50004b1
 toData,28,2ab40002b800152bb800162ab400032bb800172ab400042bb80018b1
 
 org/apache/geode/management/internal/configuration/domain/XmlEntity,4
-fromData,22,2a2bb6006b2a2bb8006cb500162a2bb8006cb50017b1
-fromDataPre_GEODE_1_1_1_0,59,2a2bb8006cb500062a2bb8006dc0006eb500032a2bb8006cb500022a2bb8006cb5001f2a2bb8006cb500052a2bb8006cb500042ab80011b50012b1
-toData,22,2a2bb600682ab400162bb800692ab400172bb80069b1
-toDataPre_GEODE_1_1_1_0,49,2ab400062bb800692ab400032bb8006a2ab400022bb800692ab4001f2bb800692ab400052bb800692ab400042bb80069b1
+fromData,22,2a2bb6006a2a2bb8006bb500162a2bb8006bb50017b1
+fromDataPre_GEODE_1_1_1_0,59,2a2bb8006bb500062a2bb8006cc0006db500032a2bb8006bb500022a2bb8006bb5001e2a2bb8006bb500052a2bb8006bb500042ab80011b50012b1
+toData,22,2a2bb600672ab400162bb800682ab400172bb80068b1
+toDataPre_GEODE_1_1_1_0,49,2ab400062bb800682ab400032bb800692ab400022bb800682ab4001e2bb800682ab400052bb800682ab400042bb80068b1
 
 org/apache/geode/management/internal/configuration/messages/ConfigurationResponse,2
 fromData,28,2a2bb8000bb500042a2bb8000bb500052a2bb8000cb6000db50006b1
@@ -2135,3 +2135,4 @@ toData,9,2ab400022bb80005b1
 org/apache/geode/redis/internal/DoubleWrapper,2
 fromData,9,2a2bb80004b50002b1
 toData,9,2ab400022bb80003b1
+
diff --git a/geode-cq/src/main/java/org/apache/geode/cache/query/internal/cq/ClientCQImpl.java b/geode-cq/src/main/java/org/apache/geode/cache/query/internal/cq/ClientCQImpl.java
index 5409999..eb3d9ce 100644
--- a/geode-cq/src/main/java/org/apache/geode/cache/query/internal/cq/ClientCQImpl.java
+++ b/geode-cq/src/main/java/org/apache/geode/cache/query/internal/cq/ClientCQImpl.java
@@ -143,7 +143,7 @@ public class ClientCQImpl extends CqQueryImpl implements ClientCQ {
         try {
           if (this.proxyCache != null) {
             if (this.proxyCache.isClosed()) {
-              throw new CacheClosedException("Cache is closed for this user.");
+              throw proxyCache.getCacheClosedException("Cache is closed for this user.");
             }
             UserAttributes.userAttributes.set(this.proxyCache.getUserAttributes());
           }
@@ -405,7 +405,7 @@ public class ClientCQImpl extends CqQueryImpl implements ClientCQ {
         try {
           if (this.proxyCache != null) {
             if (this.proxyCache.isClosed()) {
-              throw new CacheClosedException("Cache is closed for this user.");
+              throw proxyCache.getCacheClosedException("Cache is closed for this user.");
             }
             UserAttributes.userAttributes.set(this.proxyCache.getUserAttributes());
           }
@@ -517,7 +517,7 @@ public class ClientCQImpl extends CqQueryImpl implements ClientCQ {
       try {
         if (this.proxyCache != null) {
           if (this.proxyCache.isClosed()) {
-            throw new CacheClosedException("Cache is closed for this user.");
+            throw proxyCache.getCacheClosedException("Cache is closed for this user.");
           }
           UserAttributes.userAttributes.set(this.proxyCache.getUserAttributes());
         }

-- 
To stop receiving notification emails like this one, please contact
['"commits@geode.apache.org" <commits@geode.apache.org>'].

Mime
View raw message