]> git.donarmstrong.com Git - bin.git/commitdiff
use transactions and only commit after loading all of the files
authorDon Armstrong <don@donarmstrong.com>
Thu, 5 Jun 2014 18:34:09 +0000 (11:34 -0700)
committerDon Armstrong <don@donarmstrong.com>
Thu, 5 Jun 2014 18:34:09 +0000 (11:34 -0700)
bibtex_to_paper

index c7165a3b2beab9b12bd6caf1ab83d4f73313a0af..eee5f0a28c6ea95c96e1097777aa8a5d2f2baba2 100755 (executable)
@@ -156,13 +156,17 @@ sub main{
     if (exists $options{papers_directory} and
         defined $dbh
        ) {
+        $dbh->begin_work;
         load_papers_into_database($dbh,$sth,$options{papers_directory});
+        $dbh->commit;
     }
 
     p %entries if $DEBUG;
     if (keys %entries and
         defined $dbh) {
+        $dbh->begin_work;
         load_bibtex_entries_into_database($dbh,$sth,\%entries);
+        $dbh->commit;
     }
 
     p @ARGV if $DEBUG;