tx.begin();
tx.lock(site, Transaction.WRITE);
tx.commit();
/* Retrieve from the object created, and set the year*/
OQLQuery query = odmg.newOQLQuery();
query.create(queryString);
query.bind(name);
tx.begin();
List result = (List) query.execute();
assertEquals(1, result.size());
site = (Site) result.get(0);
assertNotNull(site);
assertNull(site.getYear());
tx.lock(site, Transaction.UPGRADE);
site.setYear(new Integer(2003));
tx.commit();
/* Flush the cache, and retrieve the object again */
query = odmg.newOQLQuery();
query.create(queryString);
query.bind(name);
tx.begin();
((HasBroker) tx).getBroker().clearCache();
result = (List) query.execute();
assertEquals(1, result.size());
site = (Site) result.get(0);
assertNotNull(site);
assertNotNull("year should not be null", site.getYear());
tx.commit();