127128129130131132133134135136137
lock); memoryLockManager.refresh( "auth1", t1); assertTrue(memoryLockManager.exists("auth1")); memoryLockManager.release( "auth1", t1); assertFalse(memoryLockManager.exists("auth1")); }
5455565758596061626364
new Runnable() { @Override public void run() { try { Thread.sleep(4000); memoryLockManager.release( "auth1", t1); } catch (InterruptedException e) { e.printStackTrace();
102103104105106107108109110111112
t2, "f1"); t2.commit(); // commit should not take away the lock assertTrue(memoryLockManager.exists("auth1")); memoryLockManager.release( "auth1", t1); assertFalse(memoryLockManager.exists("auth1")); }