{
service.inPropagationRequired(new Callback()
{
public void call(IDBI outer)
{
final Handle h = DBIUtil.getHandle(outer);
h.insert("insert into something (id, name) values (7, 'ignored')");
try {
service.inRequiresNewReadUncommitted(new Callback()
{
public void call(IDBI inner)
{
final Handle h = DBIUtil.getHandle(inner);
int count = h.createQuery("select count(*) from something").map(new IntegerMapper()).first();
assertEquals(1, count);
h.insert("insert into something (id, name) values (8, 'ignored again')");
throw new ForceRollback();
}
});
}
catch (ForceRollback e) {
assertTrue(true);
}
int count = h.createQuery("select count(*) from something").map(new IntegerMapper()).first();
assertEquals(1, count);
}
});
}