This is an automated email from the ASF dual-hosted git repository.
zhouxj pushed a commit to branch feature/GEODE-6973
in repository https://gitbox.apache.org/repos/asf/geode.git
The following commit(s) were added to refs/heads/feature/GEODE-6973 by this
push:
new 3b834f2 GEODE-6973: The pdxRegion.size() should be called outside of
TX context to avoid messaging.
3b834f2 is described below
commit 3b834f28b66787a156c0f69cb010611326f81f21
Author: zhouxh <[email protected]>
AuthorDate: Fri Oct 25 17:25:38 2019 -0700
GEODE-6973: The pdxRegion.size() should be called outside of TX context to
avoid messaging.
Co-authored-by: Anil <[email protected]>
Co-authored-by: Xiaojian Zhou <[email protected]>
Co-authored-by: Donal Evans <[email protected]>
---
.../apache/geode/pdx/internal/PeerTypeRegistration.java | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git
a/geode-core/src/main/java/org/apache/geode/pdx/internal/PeerTypeRegistration.java
b/geode-core/src/main/java/org/apache/geode/pdx/internal/PeerTypeRegistration.java
index f25be75..5f78f64 100644
---
a/geode-core/src/main/java/org/apache/geode/pdx/internal/PeerTypeRegistration.java
+++
b/geode-core/src/main/java/org/apache/geode/pdx/internal/PeerTypeRegistration.java
@@ -359,7 +359,7 @@ public class PeerTypeRegistration implements
TypeRegistration {
}
lock();
try {
- if (reverseMap.shouldReloadFromRegion(getIdToType())) {
+ if (shouldReload()) {
buildReverseMapsFromRegion();
}
reverseMap.flushPendingReverseMap();
@@ -629,6 +629,17 @@ public class PeerTypeRegistration implements
TypeRegistration {
}
}
+ boolean shouldReload() {
+ boolean shouldReload = false;
+ TXStateProxy currentState = suspendTX();
+ try {
+ shouldReload = reverseMap.shouldReloadFromRegion(getIdToType());
+ } finally {
+ resumeTX(currentState);
+ }
+ return shouldReload;
+ }
+
@Override
public int defineEnum(final EnumInfo newInfo) {
statistics.enumDefined();
@@ -639,7 +650,7 @@ public class PeerTypeRegistration implements
TypeRegistration {
}
lock();
try {
- if (reverseMap.shouldReloadFromRegion(getIdToType())) {
+ if (shouldReload()) {
buildReverseMapsFromRegion();
}
reverseMap.flushPendingReverseMap();