Transaction tx = pm.currentTransaction();
int i, n;
Date firstValue = new Date(2007908);
Date secondValue = new Date(890748967382l);
tx.begin();
FieldsOfDate pi = new FieldsOfDate();
pi.identifier = 1;
pm.makePersistent(pi);
Object oid = pm.getObjectId(pi);
n = pi.getLength();
// Provide initial set of values
for( i = 0; i < n; ++i){
pi.set( i, firstValue);
}
tx.commit();
// cache will be flushed
pi = null;
System.gc();
tx.begin();
pi = (FieldsOfDate) pm.getObjectById(oid, true);
checkValues(oid, firstValue);
// Provide new set of values
for( i = 0; i < n; ++i){
pi.set(i, secondValue);
}
tx.commit();
// cache will be flushed
pi = null;
System.gc();