Artist a = Cayenne.objectForPK(context, Artist.class, 1);
a.setArtistName("Y");
a = null;
assertEquals(1, context.getObjectStore().registeredObjectsCount());
new ParallelTestContainer() {
@Override
protected void assertResult() throws Exception {
System.gc();
assertEquals(1, context.getObjectStore().registeredObjectsCount());
}
}.runTest(2000);
context.commitChanges();
new ParallelTestContainer() {
@Override
protected void assertResult() throws Exception {
System.gc();
assertEquals(0, context.getObjectStore().registeredObjectsCount());