*
* @throws Exception
*/
public void testSuppressionOf2WriteLocks() throws Exception
{
TransactionManager m = cache.getTransactionManager();
m.begin();
cache.put(fqn, "x", "1");
assertEquals(2, cache.getNumberOfLocksHeld());
m.commit();
assertEquals(0, cache.getNumberOfLocksHeld());
cache.removeNode(fqn);
m.begin();
cache.getInvocationContext().getOptionOverrides().setSuppressLocking(true);
cache.put(fqn, "x", "2");
cache.getInvocationContext().getOptionOverrides().setSuppressLocking(true);
cache.put(fqn1, "y", "3");
assertEquals(0, cache.getNumberOfLocksHeld());
m.commit();
assertEquals(0, cache.getNumberOfLocksHeld());
Map<String, String> map = new HashMap<String, String>();
map.put("x", "1");
m.begin();
cache.getInvocationContext().getOptionOverrides().setSuppressLocking(true);
cache.put(fqn, map);
cache.getInvocationContext().getOptionOverrides().setSuppressLocking(true);
cache.put(fqn1, map);
assertEquals(0, cache.getNumberOfLocksHeld());
m.commit();
assertEquals(0, cache.getNumberOfLocksHeld());
// test normal operation again
cache.removeNode(fqn);
m.begin();
cache.put(fqn, "x", "3");
assertEquals(2, cache.getNumberOfLocksHeld());
m.commit();
assertEquals(0, cache.getNumberOfLocksHeld());
}