public final void traverse ( ) { //We have to check for && because 'traversalRequired' is not triggered by new objects, //but new objects may have new objects referenced that are not marked as persistent. //See issue #57. if ( ! traversalRequired && ! cache . hasDirtyPojos ( ) ) { //shortcut return ; } //Intention is to find the NEW objects that will become persistent //through reachability. //For this, we have to check objects that are DIRTY or NEW (by //makePersistent()). // DBLogger.debugPrintln(1, "Starting OGT: " + workList.size()); // long t1 = System.currentTimeMillis(); // long nObjects = 0; // // nObjects += traverseCache(); // nObjects += traverseWorkList(); // // long t2 = System.currentTimeMillis(); // DBLogger.debugPrintln(1, "Finished OGT: " + nObjects + " (seen=" // + seenObjects.size() + " ) / " + (t2-t1)/1000.0 // + " MP=" + mpCount); try { traverseCache ( ) ; traverseWorkList ( ) ; } finally { workList . clear ( ) ; toBecomePersistent . clear ( ) ; //We have to clear the seenObjects here, see also issue #58. seenObjects . clear ( ) ; } traversalRequired = false ; }
This class is only public so it can be accessed by the test harness . Please do not use .