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