Index: trunk/ippToPsps/jython/detectionbatch.py
===================================================================
--- trunk/ippToPsps/jython/detectionbatch.py	(revision 37592)
+++ trunk/ippToPsps/jython/detectionbatch.py	(revision 37763)
@@ -610,12 +610,13 @@
     '''
 
-    def updatePspsUniqueIDs(self,table):
+    def updatePspsUniqueIDs(self,table, ota):
         sql = "UPDATE "+table+" join (select @r:=@r+1 rownum, objID from \
         (select @r:=0) r, "+table+" t) as foo using (objID) set \
-        uniquePspsP2id = ((" +str(self.batchID)+ "*1000000000 ) + rownum)"
+        uniquePspsP2id = ((" +str(self.batchID)+ "*1000000000 ) \
+        + (" +str(ota) + "*10000000  )+rownum)"
         try: self.scratchDb.execute(sql)
         except:
             self.logger.errorPair('failed sql',sql)
-            return
+            raise
         
     '''
@@ -651,5 +652,6 @@
         #self.logger.info("deleted nulls")
         self.logger.info("add psps unique p2 ids")
-        self.updatePspsUniqueIDs("Detection_" + chipname, self.imageIDs[chipname])
+        ota = x*10+y
+        self.updatePspsUniqueIDs("Detection_" + chipname, ota)
         self.updateImageID("Detection_" + chipname, x, y)
         #self.logger.info("updateImageId")
