Index: /branches/eam_branches/ipp-20130711/Ohana/src/dvopsps/src/insert_detections_dvopsps.c
===================================================================
--- /branches/eam_branches/ipp-20130711/Ohana/src/dvopsps/src/insert_detections_dvopsps.c	(revision 35869)
+++ /branches/eam_branches/ipp-20130711/Ohana/src/dvopsps/src/insert_detections_dvopsps.c	(revision 35870)
@@ -182,4 +182,5 @@
   if (!PARALLEL_MANUAL && !PARALLEL_SERIAL) {
     int status = HostTableWaitJobsGetIO (table, __FILE__, __LINE__, VERBOSE);
+    if (VERBOSE) fprintf (stderr, "done reading remote tables, status: %d\n", status);
     if (!status) return FALSE;
   }
@@ -198,4 +199,14 @@
     }
 
+    // explicitly delete all entries
+    char query[256];
+    sprintf (query, "delete from dvoDetectionFull");
+    if (mysql_query (mysql, query)) {
+      fprintf (stderr, "failed to delete existing entries\n");
+      fprintf (stderr, "%s\n", mysql_error (mysql));
+      return FALSE;
+    }
+    if (VERBOSE) fprintf (stderr, "deleted existing entries\n");
+    
     for (i = 0; i < table->Nhosts; i++) {
       if ((detections = DetectionsLoad (table->hosts[i].results, &Ndetections)) == NULL) {
@@ -205,4 +216,5 @@
 	return FALSE;
       }
+      if (VERBOSE) fprintf (stderr, "read %d detections from %s\n", Ndetections, table->hosts[i].hostname);
       free (table->hosts[i].results);
       table->hosts[i].results = NULL;
