session.save();
}
}
session.save();
SessionImpl si = (SessionImpl) session;
DataStoreGarbageCollector gc = si.createDataStoreGarbageCollector();
DataStore ds = ((GarbageCollector) gc).getDataStore();
if (ds != null) {
ds.clearInUse();
boolean pmScan = gc.isPersistenceManagerScan();
gc.setPersistenceManagerScan(allowPmScan);
gotNullNode = false;
gotNode = false;
gc.setMarkEventListener(this);
gc.mark();
if (pmScan && allowPmScan) {
assertTrue("PM scan without null Node", gotNullNode);
assertFalse("PM scan, but got a real node", gotNode);
} else {
assertFalse("Not a PM scan - but got a null Node", gotNullNode);
assertTrue("Not a PM scan - without a real node", gotNode);
}
int deleted = gc.sweep();
LOG.debug("Deleted " + deleted);
assertTrue("Should delete at least one item", deleted >= 0);
gc.close();
}
}