jinmeiliao commented on a change in pull request #7088:
URL: https://github.com/apache/geode/pull/7088#discussion_r745017811



##########
File path: 
geode-cq/src/distributedTest/java/org/apache/geode/security/MultiUserAPIDUnitTest.java
##########
@@ -252,4 +283,50 @@ public void jsonFormatterOnTheClientWithMultiUser() throws 
Exception {
     PdxInstance value = regionService.getJsonFormatter().toPdxInstance(json);
     regionView.put("key", value);
   }
+
+  @Test
+  public void transactionTest() throws Exception {
+    ClientCache cache = client.withServerConnection(server.getPort())
+        .withCredential("data", "data")
+        .createCache();
+    Region<Object, Object> region = client.createProxyRegion("region");
+    CacheTransactionManager txManager =
+        cache.getCacheTransactionManager();
+
+    try {
+      txManager.begin();
+      region.put("key1", "value1");
+      region.put("key2", "value2");
+      txManager.commit();
+    } catch (CommitConflictException conflict) {
+      // ... do necessary work for a transaction that failed on commit
+    } finally {
+      if (txManager.exists()) {
+        txManager.rollback();
+      }
+    }

Review comment:
       the test was added for code understanding. Not needed.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to