You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@geode.apache.org by GitBox <gi...@apache.org> on 2021/11/08 19:12:04 UTC
[GitHub] [geode] jinmeiliao commented on a change in pull request #7088: GEODE-9792: synchronize multi-user authentication on different threads
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: notifications-unsubscribe@geode.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org