try
{
beginTx();
ALocalHome ah = AUtil.getLocalHome();
ALocal a = ah.create(id);
a.setIntField(1);
commitTx();
long lastUpdated = System.currentTimeMillis();
checkAge(lastUpdated);
assertValue(id, 1);
checkAge(lastUpdated);
jdbcUpdate(id, 2);
checkAge(lastUpdated);
assertValue(id, 1);
sleepUntilEvicted();
long lastEvicted = cacheListener.lastEvicted;
assertValue(id, 2);
// test ejb update
try
{
Thread.sleep(1000);
}
catch(InterruptedException e)
{
e.printStackTrace();
}
beginTx();
a = ah.findByPrimaryKey(id);
a.setIntField(3);
commitTx();
sleepUntilEvicted();
assertTrue(cacheListener.lastEvicted - lastEvicted >= maxAgeMs + 1000);
}