List allObjects = context.performQuery(new SelectQuery(
SimpleLockingTestEntity.class));
assertEquals(1, allObjects.size());
SimpleLockingTestEntity object = (SimpleLockingTestEntity) allObjects.get(0);
// change description and save... no optimistic lock failure expected
object.setDescription("second update");
context.commitChanges();
// change row underneath, delete and save... optimistic lock failure expected
createTestData("SimpleLockUpdate");