Index: trunk/ippToPsps/jython/stackbatch.py
===================================================================
--- trunk/ippToPsps/jython/stackbatch.py	(revision 33962)
+++ trunk/ippToPsps/jython/stackbatch.py	(revision 34165)
@@ -397,4 +397,9 @@
 
         self.scratchDb.execute(sql)
+        #it is possible to drop some detections from dvo (that are present in the cmf). when that happens we get a 0 for objid
+        #we drop those...
+        sql="DELETE FROM StackDetection where objID = 0"
+        self.scratchDb.execute(sql)
+        self.logger.infoPair("Deleting", "entries with StackDetection.objID = 0")
 
         self.scratchDb.updateAllRows("StackDetection", "surveyID", str(self.surveyID))
@@ -421,4 +426,7 @@
         self.scratchDb.reportAndDeleteRowsWithNULLS("StackDetection", "instFlux")
         self.scratchDb.reportAndDeleteRowsWithNULLS("StackDetection", "objID")
+        sql="DELETE FROM StackDetection where objID = 0"
+        self.scratchDb.execute(sql)
+        self.logger.infoPair("Deleting", "entries with StackDetection.objID = 0")
 
 
