query.addOrdering(new Ordering("db:LOCKING_TEST_ID", Ordering.ASC));
List allObjects = context.performQuery(query);
assertEquals(3, allObjects.size());
SimpleLockingTestEntity object1 = (SimpleLockingTestEntity) allObjects.get(0);
SimpleLockingTestEntity object2 = (SimpleLockingTestEntity) allObjects.get(1);
SimpleLockingTestEntity object3 = (SimpleLockingTestEntity) allObjects.get(2);
// change description and save... no optimistic lock failure expected...
object1.setDescription("first update for object1");
object2.setDescription("first update for object2");
object3.setName("object3 - new name");
context.commitChanges();
// TODO: it would be nice to pick inside DataContext to see that 3 batches where
// generated...
// this requires refactoring of ContextCommit.