// write the stuff to the database; at this stage all job.status values are zero
session.persist( batch );
session.flush();
// behind the session's back, let's modify the statuses
updateStatuses( session.connection() );
// Now lets refresh the persistent batch, and see if the refresh cascaded to the jobs collection elements
session.refresh( batch );
Iterator itr = batch.getJobs().iterator();