pcrud requires transaction begin/commit for writes...
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 10 May 2010 22:26:20 +0000 (22:26 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 10 May 2010 22:26:20 +0000 (22:26 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@16415 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/support-scripts/marc_stream_importer.pl

index ad8d408..d7a0687 100755 (executable)
@@ -272,19 +272,25 @@ sub bib_queue_import {
     }
 
     # clean up the successfully imported vandelay records to prevent queue bloat
+    my $pcrud = OpenSRF::AppSession->create('open-ils.pcrud');
+    $pcrud->connect;
+    $pcrud->request('open-ils.pcrud.transaction.begin', $authtoken);
+    my $err;
+
     foreach (@cleanup_recs) {
 
         try { 
-            $apputils->simplereq(
-                'open-ils.pcrud',
-                'open-ils.pcrud.delete.vqbr',
-                $authtoken, $_);
+
+            $pcrud->request('open-ils.pcrud.delete.vqbr', $authtoken, $_);
 
         } catch Error with {
-            my $err = shift;
+            $err = shift;
             $logger->error("Error deleteing queued bib record $_: $err");
         };
     }
+
+    $pcrud->request('open-ils.pcrud.transaction.commit', $authtoken) unless $err;
+    $pcrud->disconnect;
 }
 
 sub process_batch_data {