// make sure phantomly prefetched objects are not deallocated
context.getObjectStore().objectMap = new HashMap<Object, Persistent>();
// sanity check...
DataObject g1 = (DataObject) context.getGraphManager().getNode(
new ObjectId("Gallery", Gallery.GALLERY_ID_PK_COLUMN, 33001));
assertNull(g1);
List objects = context.performQuery(q);
blockQueries();
try {
assertEquals(3, objects.size());
Iterator it = objects.iterator();
while (it.hasNext()) {
Artist a = (Artist) it.next();
ValueHolder list = (ValueHolder) a.getPaintingArray();
assertNotNull(list);
// intermediate relationship is not fetched...
assertTrue(list.isFault());
}
// however both galleries must be in memory...
g1 = (DataObject) context.getGraphManager().getNode(
new ObjectId("Gallery", Gallery.GALLERY_ID_PK_COLUMN, 33001));
assertNotNull(g1);
assertEquals(PersistenceState.COMMITTED, g1.getPersistenceState());
DataObject g2 = (DataObject) context.getGraphManager().getNode(
new ObjectId("Gallery", Gallery.GALLERY_ID_PK_COLUMN, 33002));
assertNotNull(g2);
assertEquals(PersistenceState.COMMITTED, g2.getPersistenceState());
}
finally {
unblockQueries();