Index: /trunk/ippToPsps/config/ippToPspsDbSchema.sql
===================================================================
--- /trunk/ippToPsps/config/ippToPspsDbSchema.sql	(revision 35182)
+++ /trunk/ippToPsps/config/ippToPspsDbSchema.sql	(revision 35183)
@@ -62,5 +62,5 @@
   `dec_center` float default NULL,
   `box_side` float default NULL,
-  `ingested` tinyint(1) default '0',
+  `ingested` varchar(64) default NULL,
   PRIMARY KEY  (`id`),
   KEY `fk_skychunk` (`skychunk`),
Index: /trunk/ippToPsps/jython/dvo.py
===================================================================
--- /trunk/ippToPsps/jython/dvo.py	(revision 35182)
+++ /trunk/ippToPsps/jython/dvo.py	(revision 35183)
@@ -587,9 +587,17 @@
         # blow away existing dvoDetection table
 
-        # clear the 'ingested' field for all boxes
-        # XXX oops: this causes problems for multiple loaders...
-        # set/clear should be using the HOST id as the value in the table.
-        # self.ippToPspsDb.clearIngestedBoxes()
+        # clear the 'ingested' field for all boxes owned by this host
+        self.ippToPspsDb.clearIngestedBoxes(self.scratchDb.dbHost)
         
+        print "*******************************************************************************"
+        self.logger.warning("about to delete detection table and re-ingest; is this correct?")
+        response = raw_input("(y/n) ")
+        if response != "y":
+            raise
+        self.logger.warning("Are you ABSOLUTELY sure you want to do this?")
+        response = raw_input("(y/n) ")
+        if response != "y":
+            raise
+
         # drop detections table
         self.logger.infoPair("Dropping table", self.scratchDb.dvoDetectionTable)
@@ -644,5 +652,5 @@
         ## dvopsps can take a very long time. try 2 or 3 times to re-establish communication with the db before proceeding?
 
-        self.ippToPspsDb.setIngestedBox(boxId)
+        self.ippToPspsDb.setIngestedBox(boxId, self.scratchDb.dbHost)
 
         # add fileID column
Index: /trunk/ippToPsps/jython/ipptopspsdb.py
===================================================================
--- /trunk/ippToPsps/jython/ipptopspsdb.py	(revision 35182)
+++ /trunk/ippToPsps/jython/ipptopspsdb.py	(revision 35183)
@@ -1097,8 +1097,8 @@
     Inserts new box into box table. If it already exisits, it returns existing box id 
     '''
-    def setIngestedBox(self, id):
+    def setIngestedBox(self, id, host):
 
         # set the field 'ingested' to 1 for this box
-        sql = "update box set ingested = 1 where id = " + str(id)
+        sql = "update box set ingested = '" + host + "' where id = " + str(id)
         try:
             self.execute(sql)
@@ -1108,14 +1108,14 @@
 
     '''
-    Inserts new box into box table. If it already exisits, it returns existing box id 
-    '''
-    def clearIngestedBoxes(self):
+    Clear ingested flag for boxes owned by this host
+    '''
+    def clearIngestedBoxes(self, host):
 
         # set the field 'ingested' to 1 for this box
-        sql = "update box set ingested = 0"
+        sql = "update box set ingested = 'none' where ingested = '" + host + "'"
         try:
             self.execute(sql)
         except:
-            print "failed to clear boxes as ingested"
+            print "failed to clear ingested state for boxes owned by host ", host
             raise
 
Index: /trunk/ippToPsps/jython/loader.py
===================================================================
--- /trunk/ippToPsps/jython/loader.py	(revision 35182)
+++ /trunk/ippToPsps/jython/loader.py	(revision 35183)
@@ -148,5 +148,5 @@
 
                     ids = self.ippToPspsDb.getPendingIdsForThisBox(boxId, batchType)
-                
+               
                     # ids are the stage_ids for items to be processed (eg, stack_id for a stack CMF, cam_id for P2 smf)
 
