Index: trunk/ippToPsps/jython/loader.py
===================================================================
--- trunk/ippToPsps/jython/loader.py	(revision 33832)
+++ trunk/ippToPsps/jython/loader.py	(revision 34661)
@@ -123,13 +123,13 @@
 
                 self.logger.infoPair("Boxes with unprocessed data", "%d" % len(boxIds))
-    
+                self.logger.infoPair("numAttempts", str(numAttempts))
                 if len(boxIds) > 0: numAttempts = 0
 
                 for boxId in boxIds:
-          
+                    self.logger.infoPair("Check","client status")
                     if not self.checkClientStatus():
                         abort = True
                         break
-    
+                    self.logger.infoPair("client status", "ok")
                     # get box info. if boxes have changed, break and start again
                     try:
@@ -138,5 +138,5 @@
                         self.logger.infoPair("Can't get details for this box", "%d" % boxId)
                         break
-     
+                    self.logger.infoPair("client status", "ok")
                     ids = self.ippToPspsDb.getPendingIdsForThisBox(boxId, batchType)
                 
@@ -150,5 +150,5 @@
                     self.logger.infoPair(batchType + " items found in this box", "%d" % len(ids))
                     boxSizeWithBorder = boxDim['SIDE'] + (self.config.BORDER * 2)
-     
+                    self.logger.infoPair("got here", "ok")
                     useFullTables = 0
                     if batchType != "OB":
@@ -174,5 +174,5 @@
                         abort = True
                         break
-
+                    self.logger.infoPair("processed","ok")
             if abort or not self.checkClientStatus(): abort = True
             elif numAttempts > 1 and not self.waitForPollTime():  break
@@ -188,15 +188,20 @@
         # loop round IDs of all items to be processed
         self.ippToPspsDb.lockBatchTable()
+        self.logger.infoPair("heather:","lockbatchtable")
         unattemptedCount = 0
         for id in ids:
-    
+            self.logger.infoPair("heather:","in ids")
+            self.logger.infoPair("heather:id",str(id))
             batchID = self.ippToPspsDb.createNewBatch(batchType, id)
-            
+            self.logger.infoPair("heather:","creatednewbatch")
+            self.logger.infoPair("heather:batchId", str(batchID))
             if batchID < 0: 
                 unattemptedCount += 1
                 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")
 
             # catch any raised exceptions in batch constructors
@@ -234,12 +239,14 @@
    
             # if batch fails, ignore and move on to the next one
-            except: 
+            except Exception, e: 
+                self.logger.error("EXCEPTION: " + str(e))
                 self.logger.errorPair("Problem with this %s batch (%d)" % (batchType, id), "skipping")
                 pass
 
             if not self.checkClientStatus(): return False
-    
+            self.logger.infoPair("checkclient status", "ok")
+
             self.ippToPspsDb.lockBatchTable()
-    
+            self.logger.infoPair("lockbatchtable", "ok")
             self.logger.infoSeparator()
     
