Article a2 = new Article();
a2.setArticleId(333);
tx1.begin();
tx2.begin();
LockManager lm = LockManagerFactory.getLockManager();
assertFalse(tx1.getGUID().equals(tx2.getGUID()));
assertTrue("1st lock should succeed", lm.writeLock(tx1, a1));
assertFalse("2nd lock should not succeed", lm.writeLock(tx2, a2));
lm.releaseLock(tx2, a2);
lm.releaseLock(tx2, a1);
assertFalse(lm.checkWrite(tx2, a1));
assertFalse(lm.checkWrite(tx2, a2));
assertTrue(lm.checkWrite(tx1, a1));
assertTrue(lm.checkWrite(tx1, a2));
//assertFalse("2nd release should not succeed", lm.releaseLock(tx2, a2));
//assertFalse("2nd release should not succeed", lm.releaseLock(tx2, a1));
assertTrue("release should succeed", lm.releaseLock(tx1, a2));
assertTrue("2nd object lock should succeed", lm.writeLock(tx2, a2));
assertTrue("release 2nd object lock should succeed", lm.releaseLock(tx2, a2));
try
{
tx1.abort();
tx2.abort();