Index: trunk/ippToPsps/jython/loader.py
===================================================================
--- trunk/ippToPsps/jython/loader.py	(revision 36709)
+++ trunk/ippToPsps/jython/loader.py	(revision 37246)
@@ -160,64 +160,19 @@
                     self.logger.infoPair(batchType + " items found in this box", "%d" % len(ids))
 
-                    useFullTables = 0
                     if batchType != "OB":
-
-                        if (self.dvoDetections.useStilts):
-                            # look in DVO for this box (with extra border)
-                            self.logger.infoPair("Querying DVO for this sky area", "")
-
-                            # XXXX EAM : This code should not be used anymore
-                            boxSize = 0.0
-                            self.dvoDetections.setSkyAreaAsBox(boxDim['RA'], boxDim['DEC'], boxSize)
-                            #self.dvoDetections.setSkyArea()
-                            sizeToBeIngested = self.dvoDetections.getDiskSizeOfRegionsToBeIngested()
-                            if sizeToBeIngested == 0.0: smfsPerGB = 999999999
-                            else: smfsPerGB = len(ids)/sizeToBeIngested
-                            self.logger.infoPair("DVO to be ingested", "%7.1e GB" % sizeToBeIngested)
-                            self.logger.infoPair("smfs-per-GB", "%.1f" % smfsPerGB)
-
-                            # should do we pre-ingest stuff from DVO?
-                            # NOTE EAM : this skychunk loads the dvo detections into the mysql db
-                            # XXXX EAM : this should happen for both P2 and Stack detection
-                            # XXXX EAM : in parallel model, this should happen for all P2 & Stack batches
-                            # 
-                            if (batchType == 'P2' or batchType == 'ST' or batchType == 'DF' or batchType == 'FW') and smfsPerGB > 30:
-                                if not self.dvoDetections.sync():
-                                    self.logger.errorPair("Could not sync DVO with MySQL", "skipping")
-                                    continue
-                                
-                                useFullTables = 1
-                        else:
-                            # XXX EAM : this is not currently optional
-                            # (it is the only path). either remove the
-                            # non-native ingest code or make it an
-                            # option if we are using the native
-                            # loader, always use it need to work out a
-                            # good boundary / region strategy in
-                            # coordination with impact of mysql
-                            # insertion
-                            if not self.ippToPspsDb.isBoxIngested(boxId, self.scratchDb.dbHost):
-                                if not self.dvoDetections.nativeIngestDetections(boxId, boxDim):
-                                    self.logger.error("Unable to ingest detections with nativeIngest")
-                                    return False
-
-                            useFullTables = 1
-                
-                    ## else:
-                    ##     # if we are using the native loader, always use it
-                    ##     # need to work out a good boundary / region strategy in coordination with 
-                    ##     # impact of mysql insertion
-                    ##     self.dvoObjects.nativeIngestObjects(boxDim['RA'], boxDim['DEC'], boxSizeSansBorder)
-                    ##     useFullTables = 1
+                        if self.config.resetDvo or not self.ippToPspsDb.isBoxIngested(boxId, self.scratchDb.dbHost):
+                            if not self.dvoDetections.nativeIngestDetections(boxId, boxDim):
+                                self.logger.error("Unable to ingest detections with nativeIngest")
+                                return False
 
                     '''
                     NOTE EAM : "TheseItems" refers to each of the stack CMFs, camera SMFs, or object batches
                     '''
-                    self.logger.infoBool("Using pre-ingested DVO data?", useFullTables)
-                    if not self.processTheseItems(batchType, ids, useFullTables):
+                    if not self.processTheseItems(batchType, ids):
                         abort = True
                         break
                     self.logger.infoPair("processed","ok")
 
+            self.logger.infoPair("done with processing boxes, numAttempts: ", str(numAttempts))
             if abort or not self.checkClientStatus(): abort = True
             elif numAttempts > 1 and not self.waitForPollTime():  break
@@ -228,5 +183,5 @@
     Actually loops through items and processes them
     '''
-    def processTheseItems(self, batchType, ids, useFullTables):
+    def processTheseItems(self, batchType, ids):
     
         self.logger.infoPair("%s items queued" % batchType, "%d" % len(ids))
@@ -246,6 +201,8 @@
                 continue
             #self.logger.infoPair("heather:","passed logic")
+
             self.ippToPspsDb.unlockTables()
             #self.logger.infoPair("heather:","unlock table")
+
             self.ippToPspsDb.deletePendingItem(batchType, id)
             #self.logger.infoPair("heather:","deleted pending item")
@@ -262,6 +219,5 @@
                             self.scratchDb,
                             id,
-                            batchID,
-                            useFullTables)
+                            batchID)
                 elif batchType == "ST":
                     self.logger.infoPair("defining ST batch for sky_id:",id)
@@ -273,6 +229,5 @@
                             self.scratchDb,
                             id,
-                            batchID,
-                            useFullTables)
+                            batchID)
     
                 elif batchType == "OB":
@@ -284,6 +239,5 @@
                             self.scratchDb,
                             id,
-                            batchID,
-                            useFullTables)
+                            batchID)
     
                 elif batchType == "DF":
@@ -295,6 +249,5 @@
                             self.scratchDb,
                             id,
-                            batchID,
-                            useFullTables)
+                            batchID)
     
                 elif batchType == "DO":
@@ -306,6 +259,5 @@
                             self.scratchDb,
                             id,
-                            batchID,
-                            useFullTables)
+                            batchID)
     
                 elif batchType == "FW":
@@ -317,6 +269,5 @@
                             self.scratchDb,
                             id,
-                            batchID,
-                            useFullTables)
+                            batchID)
     
                 elif batchType == "FO":
@@ -328,6 +279,5 @@
                             self.scratchDb,
                             id,
-                            batchID,
-                            useFullTables)
+                            batchID)
                     
                 batch.run()
@@ -337,4 +287,5 @@
                 self.logger.error("EXCEPTION: " + str(e))
                 self.logger.errorPair("Problem with this %s batch (%d)" % (batchType, id), "skipping")
+                sys.exit(1)
                 pass
 
