/** Check that remote persistent regions cause conflicts */ public void testPersistentRestriction() throws Exception { final CacheTransactionManager txMgr = this.getCache().getCacheTransactionManager(); final String misConfigRegionName = getUniqueName(); Region misConfigRgn = getCache().createRegion(misConfigRegionName, getDiskRegionAttributes()); Invoke.invokeInEveryVM( new SerializableRunnable("testPersistentRestriction: Illegal Region Configuration") { public void run() { try { getCache().createRegion(misConfigRegionName, getDiskRegionAttributes()); // rgn1.put("misConfigKey", "oldmisConfigVal"); } catch (CacheException e) { Assert.fail("While creating region", e); } } }); misConfigRgn.put("misConfigKey", "oldmisConfigVal"); txMgr.begin(); try { misConfigRgn.put("misConfigKey", "newmisConfigVal"); fail("Expected an IllegalStateException with information about misconfigured regions"); } catch (UnsupportedOperationException expected) { getSystem().getLogWriter().info("Expected exception: " + expected); txMgr.rollback(); } misConfigRgn.destroyRegion(); }
@Override protected Transaction<CacheTransactionManager> beginTransactionInternal() { GemfireDatastore datastore = (GemfireDatastore) getDatastore(); final CacheTransactionManager tm = datastore.getGemfireCache().getCacheTransactionManager(); tm.begin(); return new GemfireTransaction(tm); }