make sure we rollback the aborted transactions so they are not sticking around.
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 9 Oct 2008 22:17:00 +0000 (22:17 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 9 Oct 2008 22:17:00 +0000 (22:17 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@10811 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/perlmods/OpenILS/Application/Vandelay.pm

index 680ab45..534ed56 100644 (file)
@@ -547,10 +547,15 @@ sub import_record_list_impl {
             my $rec = $e->retrieve_vandelay_queued_bib_record($rec_id) ;
             unless($rec) {
                 $conn->respond({total => $total, progress => ++$count, imported => $rec_id, err_event => $e->die_event});
+                $e->rollback;
+                next;
+            }
+
+            if($rec->import_time) {
+                $e->rollback;
                 next;
             }
 
-            next if $rec->import_time;
             $queues{$rec->queue} = 1;
 
             my $record;
@@ -566,6 +571,7 @@ sub import_record_list_impl {
 
             if($U->event_code($record)) {
                 $conn->respond({total => $total, progress => ++$count, imported => $rec_id, err_event => $record});
+                $e->rollback;
                 next;
             }
             $rec->imported_as($record->id);
@@ -573,6 +579,7 @@ sub import_record_list_impl {
 
             unless($e->update_vandelay_queued_bib_record($rec)) {
                 $conn->respond({total => $total, progress => ++$count, imported => $rec_id, err_event => $e->die_event});
+                $e->rollback;
                 next;
             }
 
@@ -581,10 +588,15 @@ sub import_record_list_impl {
             my $rec = $e->retrieve_vandelay_queued_authority_record($rec_id);
             unless($rec) {
                 $conn->respond({total => $total, progress => ++$count, imported => $rec_id, err_event => $e->die_event});
+                $e->rollback;
+                next;
+            }
+
+            if($rec->import_time) {
+                $e->rollback;
                 next;
             }
 
-            next if $rec->import_time;
             $queues{$rec->queue} = 1;
 
             my $record;
@@ -600,6 +612,7 @@ sub import_record_list_impl {
 
             if($U->event_code($record)) {
                 $conn->respond({total => $total, progress => ++$count, imported => $rec_id, err_event => $record});
+                $e->rollback;
                 next;
             }
 
@@ -607,6 +620,7 @@ sub import_record_list_impl {
             $rec->import_time('now');
             unless($e->update_vandelay_queued_authority_record($rec)) {
                 $conn->respond({total => $total, progress => ++$count, imported => $rec_id, err_event => $e->die_event});
+                $e->rollback;
                 next;
             }
         }