From: Don Armstrong Date: Thu, 5 Jun 2014 18:34:09 +0000 (-0700) Subject: use transactions and only commit after loading all of the files X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=d12330f16e1987fbab705658bdb52094d4e83e4d;p=bin.git use transactions and only commit after loading all of the files --- diff --git a/bibtex_to_paper b/bibtex_to_paper index c7165a3..eee5f0a 100755 --- a/bibtex_to_paper +++ b/bibtex_to_paper @@ -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;