Skip to content

Instantly share code, notes, and snippets.

@mmarkus
Created October 6, 2011 12:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mmarkus/1267310 to your computer and use it in GitHub Desktop.
Save mmarkus/1267310 to your computer and use it in GitHub Desktop.
public void tesNonFineGrained() throws Exception {
final Cache<String, Object> cache1 = cache(0, "atomic");
final Cache<String, Object> cache2 = cache(1, "atomic");
final AtomicMap<String, String> map1 = AtomicMapLookup.getAtomicMap(cache1, "testMultipleTx", true);
final AtomicMap<String, String> map2 = AtomicMapLookup.getAtomicMap(cache1, "testMultipleTx", true);
tm(0, "atomic").begin();
map1.put("k1", "v");
final Transaction suspend = tm(0, "atomic").suspend();
tm(0, "atomic").begin();
try {
map2.put("k2", "v");
assert false : "this should fail as a WL needs to be acquired here";
} catch (Exception e) {
//expected
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment