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

dschneider 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 783005a  GEODE-4566: remove getInstance calls from PartitionMessage 
(#1411)
783005a is described below

commit 783005a5bb62e85d0b34d2a1cdbba242cff23ee2
Author: Darrel Schneider <dschnei...@pivotal.io>
AuthorDate: Fri Feb 9 10:23:13 2018 -0800

    GEODE-4566: remove getInstance calls from PartitionMessage (#1411)
    
    * cache is now obtained from DistributionManager
    to check if the cache is closed instead of getting
    it from GemFireCacheImpl.getInstance.
    
    * setTransactionDisabled is now set without calling getInstance
---
 .../cache/DestroyPartitionedRegionMessage.java     |  1 +
 .../cache/InvalidatePartitionedRegionMessage.java  |  1 +
 .../cache/PartitionedRegionQueryEvaluator.java     |  6 ++++--
 .../PartitionedRegionFunctionResultWaiter.java     |  6 ++++--
 .../partitioned/BecomePrimaryBucketMessage.java    |  1 +
 .../cache/partitioned/BucketBackupMessage.java     |  1 +
 .../cache/partitioned/BucketSizeMessage.java       |  1 +
 .../cache/partitioned/ContainsKeyValueMessage.java |  1 +
 .../cache/partitioned/CreateBucketMessage.java     |  1 +
 .../partitioned/DeposePrimaryBucketMessage.java    |  1 +
 .../internal/cache/partitioned/DestroyMessage.java |  1 +
 .../DestroyRegionOnDataStoreMessage.java           |  1 +
 .../cache/partitioned/DumpAllPRConfigMessage.java  |  1 +
 .../internal/cache/partitioned/DumpB2NRegion.java  |  1 +
 .../cache/partitioned/DumpBucketsMessage.java      |  1 +
 .../partitioned/EndBucketCreationMessage.java      |  1 +
 .../cache/partitioned/FetchBulkEntriesMessage.java |  1 +
 .../cache/partitioned/FetchEntriesMessage.java     |  1 +
 .../cache/partitioned/FetchEntryMessage.java       |  1 +
 .../cache/partitioned/FetchKeysMessage.java        |  2 ++
 .../partitioned/FetchPartitionDetailsMessage.java  |  1 +
 .../internal/cache/partitioned/GetMessage.java     |  1 +
 .../cache/partitioned/IndexCreationMsg.java        |  1 +
 .../cache/partitioned/InterestEventMessage.java    |  1 +
 .../cache/partitioned/InvalidateMessage.java       |  2 ++
 .../partitioned/ManageBackupBucketMessage.java     |  1 +
 .../cache/partitioned/ManageBucketMessage.java     |  1 +
 .../cache/partitioned/MoveBucketMessage.java       |  1 +
 .../cache/partitioned/PRSanityCheckMessage.java    |  2 ++
 .../cache/partitioned/PRTombstoneMessage.java      |  1 +
 .../partitioned/PRUpdateEntryVersionMessage.java   |  1 +
 .../cache/partitioned/PartitionMessage.java        | 25 ++++------------------
 .../cache/partitioned/PrimaryRequestMessage.java   |  1 +
 .../internal/cache/partitioned/PutMessage.java     |  1 +
 .../cache/partitioned/RemoveBucketMessage.java     |  1 +
 .../cache/partitioned/RemoveIndexesMessage.java    |  2 ++
 .../internal/cache/partitioned/SizeMessage.java    |  1 +
 .../parallel/ParallelQueueBatchRemovalMessage.java |  1 +
 .../cache/partitioned/PartitionMessageTest.java    |  2 --
 .../java/org/apache/geode/test/fake/Fakes.java     |  4 ++++
 40 files changed, 55 insertions(+), 27 deletions(-)

diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/cache/DestroyPartitionedRegionMessage.java
 
b/geode-core/src/main/java/org/apache/geode/internal/cache/DestroyPartitionedRegionMessage.java
index 5ff2245..8db231b 100755
--- 
a/geode-core/src/main/java/org/apache/geode/internal/cache/DestroyPartitionedRegionMessage.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/cache/DestroyPartitionedRegionMessage.java
@@ -106,6 +106,7 @@ public class DestroyPartitionedRegionMessage extends 
PartitionMessage {
         new DestroyPartitionedRegionResponse(r.getSystem(), recipients);
     DestroyPartitionedRegionMessage m =
         new DestroyPartitionedRegionMessage(recipients, r, resp, event, 
serials);
+    m.setTransactionDistributed(r.getCache().getTxManager().isDistributed());
     r.getDistributionManager().putOutgoing(m);
     return resp;
   }
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/cache/InvalidatePartitionedRegionMessage.java
 
b/geode-core/src/main/java/org/apache/geode/internal/cache/InvalidatePartitionedRegionMessage.java
index 955ee82..99937d0 100644
--- 
a/geode-core/src/main/java/org/apache/geode/internal/cache/InvalidatePartitionedRegionMessage.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/cache/InvalidatePartitionedRegionMessage.java
@@ -52,6 +52,7 @@ public class InvalidatePartitionedRegionMessage extends 
PartitionMessage {
     ReplyProcessor21 response = new ReplyProcessor21(r.getSystem(), 
recipients);
     InvalidatePartitionedRegionMessage msg = new 
InvalidatePartitionedRegionMessage(recipients,
         event.getCallbackArgument(), r, response);
+    msg.setTransactionDistributed(r.getCache().getTxManager().isDistributed());
     r.getSystem().getDistributionManager().putOutgoing(msg);
     return response;
   }
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegionQueryEvaluator.java
 
b/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegionQueryEvaluator.java
index bad9d99..4120851 100644
--- 
a/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegionQueryEvaluator.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegionQueryEvaluator.java
@@ -72,6 +72,7 @@ import 
org.apache.geode.distributed.internal.membership.InternalDistributedMembe
 import org.apache.geode.internal.Assert;
 import org.apache.geode.internal.NanoTimer;
 import org.apache.geode.internal.Version;
+import org.apache.geode.internal.cache.partitioned.PartitionMessage;
 import org.apache.geode.internal.cache.partitioned.QueryMessage;
 import org.apache.geode.internal.cache.partitioned.RegionAdvisor;
 import org.apache.geode.internal.cache.partitioned.StreamingPartitionOperation;
@@ -165,7 +166,7 @@ public class PartitionedRegionQueryEvaluator extends 
StreamingPartitionOperation
     throw new UnsupportedOperationException();
   }
 
-  protected DistributionMessage createRequestMessage(InternalDistributedMember 
recipient,
+  protected PartitionMessage createRequestMessage(InternalDistributedMember 
recipient,
       ReplyProcessor21 processor, List bucketIds) {
     return new QueryMessage(recipient, this.pr.getPRId(), processor, 
this.query, this.parameters,
         bucketIds);
@@ -333,7 +334,8 @@ public class PartitionedRegionQueryEvaluator extends 
StreamingPartitionOperation
         Map.Entry<InternalDistributedMember, List<Integer>> me = itr.next();
         final InternalDistributedMember rcp = me.getKey();
         final List<Integer> bucketIds = me.getValue();
-        DistributionMessage m = createRequestMessage(rcp, processor, 
bucketIds);
+        PartitionMessage m = createRequestMessage(rcp, processor, bucketIds);
+        
m.setTransactionDistributed(this.sys.getCache().getTxManager().isDistributed());
         Set notReceivedMembers = sendMessage(m);
         if (th != null) {
           th.hook(4);
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/cache/execute/PartitionedRegionFunctionResultWaiter.java
 
b/geode-core/src/main/java/org/apache/geode/internal/cache/execute/PartitionedRegionFunctionResultWaiter.java
index c10cb26..156c2f0 100755
--- 
a/geode-core/src/main/java/org/apache/geode/internal/cache/execute/PartitionedRegionFunctionResultWaiter.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/cache/execute/PartitionedRegionFunctionResultWaiter.java
@@ -27,6 +27,7 @@ import org.apache.geode.distributed.internal.ReplyProcessor21;
 import 
org.apache.geode.distributed.internal.membership.InternalDistributedMember;
 import org.apache.geode.internal.cache.PartitionedRegion;
 import 
org.apache.geode.internal.cache.partitioned.PRFunctionStreamingResultCollector;
+import org.apache.geode.internal.cache.partitioned.PartitionMessage;
 import 
org.apache.geode.internal.cache.partitioned.PartitionedRegionFunctionStreamingMessage;
 
 /**
@@ -83,13 +84,14 @@ public class PartitionedRegionFunctionResultWaiter extends 
StreamingFunctionOper
 
     for (Map.Entry<InternalDistributedMember, FunctionRemoteContext> entry : 
recipMap.entrySet()) {
       FunctionRemoteContext context = entry.getValue();
-      DistributionMessage m = createRequestMessage(entry.getKey(), processor, 
context);
+      PartitionMessage m = createRequestMessage(entry.getKey(), processor, 
context);
+      
m.setTransactionDistributed(pr.getCache().getTxManager().isDistributed());
       this.sys.getDistributionManager().putOutgoing(m);
     }
     return processor;
   }
 
-  protected DistributionMessage createRequestMessage(InternalDistributedMember 
recipient,
+  protected PartitionMessage createRequestMessage(InternalDistributedMember 
recipient,
       ReplyProcessor21 processor, FunctionRemoteContext context) {
     PartitionedRegionFunctionStreamingMessage msg =
         new PartitionedRegionFunctionStreamingMessage(recipient, 
this.regionId, processor, context);
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/BecomePrimaryBucketMessage.java
 
b/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/BecomePrimaryBucketMessage.java
index d962d31..5a4a7cf 100644
--- 
a/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/BecomePrimaryBucketMessage.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/BecomePrimaryBucketMessage.java
@@ -85,6 +85,7 @@ public class BecomePrimaryBucketMessage extends 
PartitionMessage {
         new BecomePrimaryBucketResponse(pr.getSystem(), recipient, pr);
     BecomePrimaryBucketMessage msg =
         new BecomePrimaryBucketMessage(recipient, pr.getPRId(), response, bid, 
isRebalance);
+    
msg.setTransactionDistributed(pr.getCache().getTxManager().isDistributed());
 
     Set<InternalDistributedMember> failures = 
pr.getDistributionManager().putOutgoing(msg);
     if (failures != null && failures.size() > 0) {
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/BucketBackupMessage.java
 
b/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/BucketBackupMessage.java
index e4a7af6..c2b5db1 100644
--- 
a/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/BucketBackupMessage.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/BucketBackupMessage.java
@@ -64,6 +64,7 @@ public class BucketBackupMessage extends PartitionMessage {
   public static void send(Set recipients, PartitionedRegion r, int bucketId) {
     Assert.assertTrue(recipients != null, "BucketBackupMessage NULL sender 
list");
     BucketBackupMessage m = new BucketBackupMessage(recipients, r.getPRId(), 
bucketId);
+    m.setTransactionDistributed(r.getCache().getTxManager().isDistributed());
     r.getDistributionManager().putOutgoing(m);
   }
 
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/BucketSizeMessage.java
 
b/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/BucketSizeMessage.java
index 25a60ee..38c3ef2 100644
--- 
a/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/BucketSizeMessage.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/BucketSizeMessage.java
@@ -84,6 +84,7 @@ public class BucketSizeMessage extends PartitionMessage {
     Assert.assertTrue(recipient != null, "BucketSizeMessage NULL reply 
message");
     BucketSizeResponse p = new BucketSizeResponse(r.getSystem(), 
Collections.singleton(recipient));
     BucketSizeMessage m = new BucketSizeMessage(recipient, r.getPRId(), p, 
bucketId);
+    m.setTransactionDistributed(r.getCache().getTxManager().isDistributed());
     Set failures = r.getDistributionManager().putOutgoing(m);
     if (failures != null && failures.size() > 0) {
       throw new ForceReattemptException(
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/ContainsKeyValueMessage.java
 
b/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/ContainsKeyValueMessage.java
index 44c7cc4..25560bb 100644
--- 
a/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/ContainsKeyValueMessage.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/ContainsKeyValueMessage.java
@@ -89,6 +89,7 @@ public class ContainsKeyValueMessage extends 
PartitionMessageWithDirectReply {
         new ContainsKeyValueResponse(r.getSystem(), 
Collections.singleton(recipient), key);
     ContainsKeyValueMessage m =
         new ContainsKeyValueMessage(recipient, r.getPRId(), p, key, bucketId, 
valueCheck);
+    m.setTransactionDistributed(r.getCache().getTxManager().isDistributed());
 
     Set failures = r.getDistributionManager().putOutgoing(m);
     if (failures != null && failures.size() > 0) {
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/CreateBucketMessage.java
 
b/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/CreateBucketMessage.java
index c004526..e3e4560 100644
--- 
a/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/CreateBucketMessage.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/CreateBucketMessage.java
@@ -101,6 +101,7 @@ public class CreateBucketMessage extends PartitionMessage {
     NodeResponse p = new NodeResponse(r.getSystem(), recipient);
     CreateBucketMessage m =
         new CreateBucketMessage(recipient, r.getPRId(), p, bucketId, 
bucketSize);
+    m.setTransactionDistributed(r.getCache().getTxManager().isDistributed());
 
     p.enableSevereAlertProcessing();
 
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/DeposePrimaryBucketMessage.java
 
b/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/DeposePrimaryBucketMessage.java
index 8d61322..249e41c 100755
--- 
a/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/DeposePrimaryBucketMessage.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/DeposePrimaryBucketMessage.java
@@ -77,6 +77,7 @@ public class DeposePrimaryBucketMessage extends 
PartitionMessage {
         new DeposePrimaryBucketResponse(region.getSystem(), recipient, region);
     DeposePrimaryBucketMessage msg =
         new DeposePrimaryBucketMessage(recipient, region.getPRId(), response, 
bucketId);
+    
msg.setTransactionDistributed(region.getCache().getTxManager().isDistributed());
 
     Set<InternalDistributedMember> failures = 
region.getDistributionManager().putOutgoing(msg);
     if (failures != null && failures.size() > 0) {
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/DestroyMessage.java
 
b/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/DestroyMessage.java
index fa5a93a..f4f238e 100644
--- 
a/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/DestroyMessage.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/DestroyMessage.java
@@ -177,6 +177,7 @@ public class DestroyMessage extends 
PartitionMessageWithDirectReply {
       DirectReplyProcessor processor) {
     DestroyMessage msg =
         new DestroyMessage(Collections.EMPTY_SET, true, r.getPRId(), 
processor, event, null);
+    msg.setTransactionDistributed(r.getCache().getTxManager().isDistributed());
     msg.versionTag = event.getVersionTag();
     return msg.relayToListeners(cacheOpReceivers, adjunctRecipients, 
filterRoutingInfo, event, r,
         processor);
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/DestroyRegionOnDataStoreMessage.java
 
b/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/DestroyRegionOnDataStoreMessage.java
index fa53007..64bc795 100644
--- 
a/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/DestroyRegionOnDataStoreMessage.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/DestroyRegionOnDataStoreMessage.java
@@ -61,6 +61,7 @@ public class DestroyRegionOnDataStoreMessage extends 
PartitionMessage {
     int procId = rp.getProcessorId();
     DestroyRegionOnDataStoreMessage m =
         new DestroyRegionOnDataStoreMessage(recipient, r.getPRId(), rp, 
callbackArg);
+    m.setTransactionDistributed(r.getCache().getTxManager().isDistributed());
     r.getDistributionManager().putOutgoing(m);
     rp.waitForRepliesUninterruptibly();
   }
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/DumpAllPRConfigMessage.java
 
b/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/DumpAllPRConfigMessage.java
index 0a00e9a..91b1936 100755
--- 
a/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/DumpAllPRConfigMessage.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/DumpAllPRConfigMessage.java
@@ -44,6 +44,7 @@ public class DumpAllPRConfigMessage extends PartitionMessage {
   public static PartitionResponse send(Set recipients, PartitionedRegion r) {
     PartitionResponse p = new PartitionResponse(r.getSystem(), recipients);
     DumpAllPRConfigMessage m = new DumpAllPRConfigMessage(recipients, 
r.getPRId(), p);
+    m.setTransactionDistributed(r.getCache().getTxManager().isDistributed());
 
     /* Set failures = */r.getDistributionManager().putOutgoing(m);
     // if (failures != null && failures.size() > 0) {
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/DumpB2NRegion.java
 
b/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/DumpB2NRegion.java
index 8c2cc06..bd8d11b 100644
--- 
a/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/DumpB2NRegion.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/DumpB2NRegion.java
@@ -74,6 +74,7 @@ public class DumpB2NRegion extends PartitionMessage {
       boolean justPrimaryInfo) {
     DumpB2NResponse p = new DumpB2NResponse(r.getSystem(), recipients);
     DumpB2NRegion m = new DumpB2NRegion(recipients, r.getPRId(), p, bId, 
justPrimaryInfo);
+    m.setTransactionDistributed(r.getCache().getTxManager().isDistributed());
     r.getDistributionManager().putOutgoing(m);
     return p;
   }
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/DumpBucketsMessage.java
 
b/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/DumpBucketsMessage.java
index a347073..05ae825 100644
--- 
a/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/DumpBucketsMessage.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/DumpBucketsMessage.java
@@ -56,6 +56,7 @@ public class DumpBucketsMessage extends PartitionMessage {
     PartitionResponse p = new PartitionResponse(r.getSystem(), recipients);
     DumpBucketsMessage m =
         new DumpBucketsMessage(recipients, r.getPRId(), p, validateOnly, 
onlyBuckets);
+    m.setTransactionDistributed(r.getCache().getTxManager().isDistributed());
 
     /* Set failures = */ r.getDistributionManager().putOutgoing(m);
     // if (failures != null && failures.size() > 0) {
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/EndBucketCreationMessage.java
 
b/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/EndBucketCreationMessage.java
index 0ab10bb..21f72b8 100644
--- 
a/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/EndBucketCreationMessage.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/EndBucketCreationMessage.java
@@ -68,6 +68,7 @@ public class EndBucketCreationMessage extends 
PartitionMessage {
     ReplyProcessor21 response = new ReplyProcessor21(pr.getSystem(), 
acceptedMembers);
     EndBucketCreationMessage msg =
         new EndBucketCreationMessage(acceptedMembers, pr.getPRId(), response, 
bid, newPrimary);
+    
msg.setTransactionDistributed(pr.getCache().getTxManager().isDistributed());
 
     pr.getDistributionManager().putOutgoing(msg);
   }
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/FetchBulkEntriesMessage.java
 
b/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/FetchBulkEntriesMessage.java
index 396b68b..b73f8ec 100644
--- 
a/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/FetchBulkEntriesMessage.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/FetchBulkEntriesMessage.java
@@ -116,6 +116,7 @@ public class FetchBulkEntriesMessage extends 
PartitionMessage {
     FetchBulkEntriesResponse p = new FetchBulkEntriesResponse(r.getSystem(), 
r, recipient);
     FetchBulkEntriesMessage m = new FetchBulkEntriesMessage(recipient, 
r.getPRId(), p, bucketKeys,
         bucketIds, regex, allowTombstones);
+    m.setTransactionDistributed(r.getCache().getTxManager().isDistributed());
 
     Set failures = r.getDistributionManager().putOutgoing(m);
     if (failures != null && failures.size() > 0) {
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/FetchEntriesMessage.java
 
b/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/FetchEntriesMessage.java
index 1119048..5b2f574 100644
--- 
a/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/FetchEntriesMessage.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/FetchEntriesMessage.java
@@ -91,6 +91,7 @@ public class FetchEntriesMessage extends PartitionMessage {
     Assert.assertTrue(recipient != null, "FetchEntriesMessage NULL reply 
message");
     FetchEntriesResponse p = new FetchEntriesResponse(r.getSystem(), r, 
recipient, bucketId);
     FetchEntriesMessage m = new FetchEntriesMessage(recipient, r.getPRId(), p, 
bucketId);
+    m.setTransactionDistributed(r.getCache().getTxManager().isDistributed());
 
     Set failures = r.getDistributionManager().putOutgoing(m);
     if (failures != null && failures.size() > 0) {
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/FetchEntryMessage.java
 
b/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/FetchEntryMessage.java
index 9fa9fb0..ea08ef2 100644
--- 
a/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/FetchEntryMessage.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/FetchEntryMessage.java
@@ -93,6 +93,7 @@ public class FetchEntryMessage extends PartitionMessage {
     FetchEntryResponse p =
         new FetchEntryResponse(r.getSystem(), 
Collections.singleton(recipient), r, key);
     FetchEntryMessage m = new FetchEntryMessage(recipient, r.getPRId(), p, 
key, access);
+    m.setTransactionDistributed(r.getCache().getTxManager().isDistributed());
 
     Set failures = r.getDistributionManager().putOutgoing(m);
     if (failures != null && failures.size() > 0) {
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/FetchKeysMessage.java
 
b/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/FetchKeysMessage.java
index 87e21e9..44acfb6 100644
--- 
a/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/FetchKeysMessage.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/FetchKeysMessage.java
@@ -98,6 +98,7 @@ public class FetchKeysMessage extends PartitionMessage {
         (FetchKeysResponse) tmp.createReplyProcessor(r, 
Collections.singleton(recipient));
     FetchKeysMessage m = new FetchKeysMessage(recipient, r.getPRId(), p, 
bucketId,
         InterestType.REGULAR_EXPRESSION, ".*", allowTombstones);
+    m.setTransactionDistributed(r.getCache().getTxManager().isDistributed());
 
     Set failures = r.getDistributionManager().putOutgoing(m);
     if (failures != null && failures.size() > 0) {
@@ -127,6 +128,7 @@ public class FetchKeysMessage extends PartitionMessage {
         (FetchKeysResponse) tmp.createReplyProcessor(r, 
Collections.singleton(recipient));
     FetchKeysMessage m =
         new FetchKeysMessage(recipient, r.getPRId(), p, bucketId, itype, arg, 
allowTombstones);
+    m.setTransactionDistributed(r.getCache().getTxManager().isDistributed());
     Set failures = r.getDistributionManager().putOutgoing(m);
     if (failures != null && failures.size() > 0) {
       throw new ForceReattemptException(
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/FetchPartitionDetailsMessage.java
 
b/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/FetchPartitionDetailsMessage.java
index e900a71..cbc6218 100755
--- 
a/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/FetchPartitionDetailsMessage.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/FetchPartitionDetailsMessage.java
@@ -80,6 +80,7 @@ public class FetchPartitionDetailsMessage extends 
PartitionMessage {
         new FetchPartitionDetailsResponse(region.getSystem(), recipients, 
region);
     FetchPartitionDetailsMessage msg = new 
FetchPartitionDetailsMessage(recipients,
         region.getPRId(), response, internal, fetchOfflineMembers, probe);
+    
msg.setTransactionDistributed(region.getCache().getTxManager().isDistributed());
 
     /* Set<InternalDistributedMember> failures = */
     region.getDistributionManager().putOutgoing(msg);
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 200d53a..b13df25 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
@@ -288,6 +288,7 @@ public class GetMessage extends 
PartitionMessageWithDirectReply {
     GetResponse p = new GetResponse(r.getSystem(), 
Collections.singleton(recipient), key);
     GetMessage m = new GetMessage(recipient, r.getPRId(), p, key, 
aCallbackArgument,
         requestingClient, returnTombstones);
+    m.setTransactionDistributed(r.getCache().getTxManager().isDistributed());
     Set failures = r.getDistributionManager().putOutgoing(m);
     if (failures != null && failures.size() > 0) {
       throw new ForceReattemptException(
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/IndexCreationMsg.java
 
b/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/IndexCreationMsg.java
index 48515c7..35c4717 100755
--- 
a/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/IndexCreationMsg.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/IndexCreationMsg.java
@@ -374,6 +374,7 @@ public class IndexCreationMsg extends PartitionMessage {
 
     IndexCreationMsg indMsg =
         new IndexCreationMsg(recipients, pr.getPRId(), processor, 
indexDefinitions);
+    
indMsg.setTransactionDistributed(pr.getCache().getTxManager().isDistributed());
     if (logger.isDebugEnabled()) {
       logger.debug("Sending index creation message: {}, to member(s) {}.", 
indMsg, recipients);
     }
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/InterestEventMessage.java
 
b/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/InterestEventMessage.java
index c84a449..52cc2f2 100755
--- 
a/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/InterestEventMessage.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/InterestEventMessage.java
@@ -127,6 +127,7 @@ public class InterestEventMessage extends PartitionMessage {
     InterestEventResponse response = new 
InterestEventResponse(region.getSystem(), recipients);
     InterestEventMessage m = new InterestEventMessage(recipients, 
region.getPRId(),
         response.getProcessorId(), event, response);
+    
m.setTransactionDistributed(region.getCache().getTxManager().isDistributed());
 
     Set failures = region.getDistributionManager().putOutgoing(m);
     if (failures != null && failures.size() > 0) {
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/InvalidateMessage.java
 
b/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/InvalidateMessage.java
index e2e0af2..9a7715d 100644
--- 
a/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/InvalidateMessage.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/InvalidateMessage.java
@@ -109,6 +109,7 @@ public class InvalidateMessage extends DestroyMessage {
       DirectReplyProcessor processor) {
     InvalidateMessage msg =
         new InvalidateMessage(Collections.EMPTY_SET, true, r.getPRId(), 
processor, event);
+    msg.setTransactionDistributed(r.getCache().getTxManager().isDistributed());
     msg.versionTag = event.getVersionTag();
     return msg.relayToListeners(cacheOpReceivers, adjunctRecipients, 
filterRoutingInfo, event, r,
         processor);
@@ -133,6 +134,7 @@ public class InvalidateMessage extends DestroyMessage {
     Set recipients = Collections.singleton(recipient);
     InvalidateResponse p = new InvalidateResponse(r.getSystem(), recipients, 
event.getKey());
     InvalidateMessage m = new InvalidateMessage(recipients, false, 
r.getPRId(), p, event);
+    m.setTransactionDistributed(r.getCache().getTxManager().isDistributed());
     Set failures = r.getDistributionManager().putOutgoing(m);
     if (failures != null && failures.size() > 0) {
       throw new ForceReattemptException(
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/ManageBackupBucketMessage.java
 
b/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/ManageBackupBucketMessage.java
index f24ef2f..eaddfb0 100644
--- 
a/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/ManageBackupBucketMessage.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/ManageBackupBucketMessage.java
@@ -110,6 +110,7 @@ public class ManageBackupBucketMessage extends 
PartitionMessage {
     NodeResponse p = new NodeResponse(r.getSystem(), recipient);
     ManageBackupBucketMessage m = new ManageBackupBucketMessage(recipient, 
r.getPRId(), p, bucketId,
         isRebalance, replaceOfflineData, moveSource, forceCreation);
+    m.setTransactionDistributed(r.getCache().getTxManager().isDistributed());
 
     p.enableSevereAlertProcessing();
 
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/ManageBucketMessage.java
 
b/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/ManageBucketMessage.java
index b39eeca..64d0b2d 100644
--- 
a/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/ManageBucketMessage.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/ManageBucketMessage.java
@@ -101,6 +101,7 @@ public class ManageBucketMessage extends PartitionMessage {
     NodeResponse p = new NodeResponse(r.getSystem(), recipient);
     ManageBucketMessage m =
         new ManageBucketMessage(recipient, r.getPRId(), p, bucketId, 
bucketSize, forceCreation);
+    m.setTransactionDistributed(r.getCache().getTxManager().isDistributed());
 
     p.enableSevereAlertProcessing();
 
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/MoveBucketMessage.java
 
b/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/MoveBucketMessage.java
index c961f18..1441d3e 100755
--- 
a/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/MoveBucketMessage.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/MoveBucketMessage.java
@@ -84,6 +84,7 @@ public class MoveBucketMessage extends PartitionMessage {
     MoveBucketResponse response = new MoveBucketResponse(region.getSystem(), 
recipient, region);
     MoveBucketMessage msg =
         new MoveBucketMessage(recipient, region.getPRId(), response, bucketId, 
source);
+    
msg.setTransactionDistributed(region.getCache().getTxManager().isDistributed());
 
     Set<InternalDistributedMember> failures = 
region.getDistributionManager().putOutgoing(msg);
     if (failures != null && failures.size() > 0) {
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/PRSanityCheckMessage.java
 
b/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/PRSanityCheckMessage.java
index 66227f3..7b3038a 100755
--- 
a/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/PRSanityCheckMessage.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/PRSanityCheckMessage.java
@@ -110,8 +110,10 @@ public class PRSanityCheckMessage extends PartitionMessage 
{
       }
       final PRSanityCheckMessage delayedInstance =
           new PRSanityCheckMessage(recipients, pr.getPRId(), null, 
pr.getRegionIdentifier());
+      
delayedInstance.setTransactionDistributed(pr.getCache().getTxManager().isDistributed());
       PRSanityCheckMessage instance =
           new PRSanityCheckMessage(recipients, pr.getPRId(), null, 
pr.getRegionIdentifier());
+      
instance.setTransactionDistributed(pr.getCache().getTxManager().isDistributed());
       dm.putOutgoing(instance);
       int sanityCheckInterval = Integer
           .getInteger(DistributionConfig.GEMFIRE_PREFIX + 
"PRSanityCheckInterval", 5000).intValue();
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/PRTombstoneMessage.java
 
b/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/PRTombstoneMessage.java
index d2d62a8..807ab37 100644
--- 
a/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/PRTombstoneMessage.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/PRTombstoneMessage.java
@@ -75,6 +75,7 @@ public class PRTombstoneMessage extends 
PartitionMessageWithDirectReply
     PartitionResponse p = new Response(r.getSystem(), recipients);
     PRTombstoneMessage m =
         new PRTombstoneMessage(recipients, r.getPartitionedRegion().getPRId(), 
p, keys, eventID);
+    m.setTransactionDistributed(r.getCache().getTxManager().isDistributed());
     r.getDistributionManager().putOutgoing(m);
 
     try {
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/PRUpdateEntryVersionMessage.java
 
b/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/PRUpdateEntryVersionMessage.java
index 5b40f7f..e7cbba7 100644
--- 
a/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/PRUpdateEntryVersionMessage.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/PRUpdateEntryVersionMessage.java
@@ -268,6 +268,7 @@ public class PRUpdateEntryVersionMessage extends 
PartitionMessageWithDirectReply
         new UpdateEntryVersionResponse(r.getSystem(), recipient, 
event.getKey());
     PRUpdateEntryVersionMessage m =
         new PRUpdateEntryVersionMessage(recipients, r.getPRId(), p, event);
+    m.setTransactionDistributed(r.getCache().getTxManager().isDistributed());
 
     Set failures = r.getDistributionManager().putOutgoing(m);
     if (failures != null && failures.size() > 0) {
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 d2c2cd7..5d8c77b 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
@@ -52,7 +52,6 @@ import org.apache.geode.internal.cache.DataLocationException;
 import org.apache.geode.internal.cache.EntryEventImpl;
 import org.apache.geode.internal.cache.FilterRoutingInfo;
 import org.apache.geode.internal.cache.ForceReattemptException;
-import org.apache.geode.internal.cache.GemFireCacheImpl;
 import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.internal.cache.PartitionedRegion;
 import org.apache.geode.internal.cache.PartitionedRegionException;
@@ -138,7 +137,6 @@ public abstract class PartitionMessage extends 
DistributionMessage
       processor.enableSevereAlertProcessing();
     }
     initTxMemberId();
-    setIfTransactionDistributed();
   }
 
   public PartitionMessage(Collection<InternalDistributedMember> recipients, 
int regionId,
@@ -150,7 +148,6 @@ public abstract class PartitionMessage extends 
DistributionMessage
       processor.enableSevereAlertProcessing();
     }
     initTxMemberId();
-    setIfTransactionDistributed();
   }
 
 
@@ -254,8 +251,10 @@ public abstract class PartitionMessage extends 
DistributionMessage
    * check to see if the cache is closing
    */
   public boolean checkCacheClosing(ClusterDistributionManager dm) {
-    InternalCache cache = getInternalCache();
-    // return (cache != null && cache.isClosed());
+    if (dm == null) {
+      return true;
+    }
+    InternalCache cache = dm.getCache();
     return cache == null || cache.isClosed();
   }
 
@@ -273,10 +272,6 @@ public abstract class PartitionMessage extends 
DistributionMessage
     return PartitionedRegion.getPRFromId(this.regionId);
   }
 
-  InternalCache getInternalCache() {
-    return GemFireCacheImpl.getInstance();
-  }
-
   TXManagerImpl getTXManagerImpl(InternalCache cache) {
     return cache.getTxManager();
   }
@@ -853,16 +848,4 @@ public abstract class PartitionMessage extends 
DistributionMessage
   public void setTransactionDistributed(boolean isDistTx) {
     this.isTransactionDistributed = isDistTx;
   }
-
-  /*
-   * For Distributed Tx
-   */
-  private void setIfTransactionDistributed() {
-    InternalCache cache = GemFireCacheImpl.getInstance();
-    if (cache != null) {
-      if (cache.getTxManager() != null) {
-        this.isTransactionDistributed = cache.getTxManager().isDistributed();
-      }
-    }
-  }
 }
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/PrimaryRequestMessage.java
 
b/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/PrimaryRequestMessage.java
index 5859f2c..300dd44 100644
--- 
a/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/PrimaryRequestMessage.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/PrimaryRequestMessage.java
@@ -69,6 +69,7 @@ public class PrimaryRequestMessage extends PartitionMessage {
     Assert.assertTrue(recipients != null, "PrimaryRequestMessage NULL 
recipient");
     PrimaryResponse p = new PrimaryResponse(r.getSystem(), recipients);
     PrimaryRequestMessage m = new PrimaryRequestMessage(recipients, 
r.getPRId(), p, bucketId);
+    m.setTransactionDistributed(r.getCache().getTxManager().isDistributed());
 
     Set failures = r.getDistributionManager().putOutgoing(m);
     if (failures != null && failures.size() > 0) {
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/PutMessage.java
 
b/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/PutMessage.java
index 229dc5c..5642944 100644
--- 
a/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/PutMessage.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/PutMessage.java
@@ -303,6 +303,7 @@ public class PutMessage extends 
PartitionMessageWithDirectReply implements NewVa
       boolean ifOld, DirectReplyProcessor processor, boolean 
sendDeltaWithFullValue) {
     PutMessage msg = new PutMessage(Collections.EMPTY_SET, true, r.getPRId(), 
processor, event, 0,
         ifNew, ifOld, null, false);
+    msg.setTransactionDistributed(r.getCache().getTxManager().isDistributed());
     msg.setInternalDs(r.getSystem());
     msg.versionTag = event.getVersionTag();
     msg.setSendDeltaWithFullValue(sendDeltaWithFullValue);
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/RemoveBucketMessage.java
 
b/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/RemoveBucketMessage.java
index ff20221..d5cc797 100755
--- 
a/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/RemoveBucketMessage.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/RemoveBucketMessage.java
@@ -80,6 +80,7 @@ public class RemoveBucketMessage extends PartitionMessage {
     RemoveBucketResponse response = new 
RemoveBucketResponse(region.getSystem(), recipient, region);
     RemoveBucketMessage msg = new RemoveBucketMessage(recipient, 
region.getPRId(), response,
         bucketId, forceRemovePrimary);
+    
msg.setTransactionDistributed(region.getCache().getTxManager().isDistributed());
 
     Set<InternalDistributedMember> failures = 
region.getDistributionManager().putOutgoing(msg);
     if (failures != null && failures.size() > 0) {
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/RemoveIndexesMessage.java
 
b/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/RemoveIndexesMessage.java
index e3c3ca1..cd81aa4 100755
--- 
a/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/RemoveIndexesMessage.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/RemoveIndexesMessage.java
@@ -199,11 +199,13 @@ public class RemoveIndexesMessage extends 
PartitionMessage {
     }
     if (removeAllIndex) {
       RemoveIndexesMessage rm = new RemoveIndexesMessage(recipients, 
pr.getPRId(), processor);
+      
rm.setTransactionDistributed(pr.getCache().getTxManager().isDistributed());
       /* Set failures = */ pr.getDistributionManager().putOutgoing(rm);
     } else {
       // remove a single index.
       RemoveIndexesMessage rm =
           new RemoveIndexesMessage(recipients, pr.getPRId(), processor, true, 
ind.getName());
+      
rm.setTransactionDistributed(pr.getCache().getTxManager().isDistributed());
       /* Set failures = */ pr.getDistributionManager().putOutgoing(rm);
     }
     return processor;
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/SizeMessage.java
 
b/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/SizeMessage.java
index 0dbec2b..eca0ef8 100644
--- 
a/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/SizeMessage.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/SizeMessage.java
@@ -100,6 +100,7 @@ public class SizeMessage extends PartitionMessage {
     Assert.assertTrue(recipients != null, "SizeMessage NULL recipients set");
     SizeResponse p = new SizeResponse(r.getSystem(), recipients);
     SizeMessage m = new SizeMessage(recipients, r.getPRId(), p, bucketIds, 
estimate);
+    m.setTransactionDistributed(r.getCache().getTxManager().isDistributed());
     r.getDistributionManager().putOutgoing(m);
     return p;
   }
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/cache/wan/parallel/ParallelQueueBatchRemovalMessage.java
 
b/geode-core/src/main/java/org/apache/geode/internal/cache/wan/parallel/ParallelQueueBatchRemovalMessage.java
index e308527..b34fc3a 100644
--- 
a/geode-core/src/main/java/org/apache/geode/internal/cache/wan/parallel/ParallelQueueBatchRemovalMessage.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/cache/wan/parallel/ParallelQueueBatchRemovalMessage.java
@@ -130,6 +130,7 @@ public class ParallelQueueBatchRemovalMessage extends 
PartitionMessage {
         new ParallelQueueBatchRemovalResponse(pr.getSystem(), recipients, pr);
     ParallelQueueBatchRemovalMessage msg =
         new ParallelQueueBatchRemovalMessage(recipients, pr.getPRId(), 
response, bucketToTailKey);
+    
msg.setTransactionDistributed(pr.getCache().getTxManager().isDistributed());
 
     Set<InternalDistributedMember> failures = 
pr.getDistributionManager().putOutgoing(msg);
 
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 cfdb368..2219a32 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
@@ -59,7 +59,6 @@ public class PartitionMessageTest {
     when(msg.checkCacheClosing(dm)).thenReturn(false);
     when(msg.checkDSClosing(dm)).thenReturn(false);
     when(msg.getPartitionedRegion()).thenReturn(pr);
-    when(msg.getInternalCache()).thenReturn(cache);
     when(msg.getStartPartitionMessageProcessingTime(pr)).thenReturn(startTime);
     when(msg.getTXManagerImpl(cache)).thenReturn(txMgr);
     when(dm.getCache()).thenReturn(cache);
@@ -108,7 +107,6 @@ public class PartitionMessageTest {
   public void noNewTxProcessingAfterTXManagerImplClosed() throws Exception {
     txMgr = new TXManagerImpl(null, cache);
     when(msg.getPartitionedRegion()).thenReturn(pr);
-    when(msg.getInternalCache()).thenReturn(cache);
     when(msg.getStartPartitionMessageProcessingTime(pr)).thenReturn(startTime);
     when(msg.getTXManagerImpl(cache)).thenReturn(txMgr);
     when(msg.canParticipateInTransaction()).thenReturn(true);
diff --git a/geode-core/src/test/java/org/apache/geode/test/fake/Fakes.java 
b/geode-core/src/test/java/org/apache/geode/test/fake/Fakes.java
index c872c08..31852dd 100644
--- a/geode-core/src/test/java/org/apache/geode/test/fake/Fakes.java
+++ b/geode-core/src/test/java/org/apache/geode/test/fake/Fakes.java
@@ -34,6 +34,7 @@ import 
org.apache.geode.distributed.internal.InternalDistributedSystem;
 import 
org.apache.geode.distributed.internal.membership.InternalDistributedMember;
 import org.apache.geode.internal.cache.CachePerfStats;
 import org.apache.geode.internal.cache.GemFireCacheImpl;
+import org.apache.geode.internal.cache.TXManagerImpl;
 import org.apache.geode.internal.security.SecurityService;
 import org.apache.geode.pdx.PdxInstanceFactory;
 
@@ -68,6 +69,7 @@ public class Fakes {
     DSClock clock = mock(DSClock.class);
     LogWriter logger = mock(LogWriter.class);
     Statistics stats = mock(Statistics.class);
+    TXManagerImpl txManager = mock(TXManagerImpl.class);
 
     InternalDistributedMember member;
     member = new InternalDistributedMember("localhost", 5555);
@@ -84,6 +86,7 @@ public class Fakes {
     when(cache.getCachePerfStats()).thenReturn(mock(CachePerfStats.class));
     when(cache.getSecurityService()).thenReturn(mock(SecurityService.class));
     when(cache.createPdxInstanceFactory(any())).thenReturn(pdxInstanceFactory);
+    when(cache.getTxManager()).thenReturn(txManager);
 
     when(system.getDistributedMember()).thenReturn(member);
     when(system.getConfig()).thenReturn(config);
@@ -94,6 +97,7 @@ public class Fakes {
     when(system.getSecurityService()).thenReturn(mock(SecurityService.class));
     when(system.createAtomicStatistics(any(), any(), 
anyLong())).thenReturn(stats);
     when(system.createAtomicStatistics(any(), any())).thenReturn(stats);
+    when(system.getCache()).thenReturn(cache);
 
     when(distributionManager.getId()).thenReturn(member);
     when(distributionManager.getDistributionManagerId()).thenReturn(member);

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

Reply via email to