diff --git a/phosta b/phosta

index dae1db89a8c06c826627cf741a2863906c541a86..bbdee39805cac705aee0e4873490e8e3c469b4cc 100755

--- a/phosta

+++ b/phosta

@@ -162,7 +162,7 @@ my $cmd = "exiftool -fast2 -r -m -f -p '\$filepath##\$make##\$model##\$lensmake##\$lens##\$lensmodel##\$focallength##\$focallengthin35mmformat##\$aperture##\$exposuretime##\$shutterspeed##\$iso##\$flash##\$datetimeoriginal' -d \"%Y-%m-%d %H:%M:%S\" " . $extensions . "\"$opt_p\"";

!$opt_v or say "### Exiftool command: $cmd";

my @lines = `$cmd`;

- my $dbh = DBI->connect($dsn, '', '', { RaiseError => 1 }) or die $DBI::errstr;

+ my $dbh = DBI->connect($dsn, '', '', { RaiseError => 1, AutoCommit => 0 }) or die $DBI::errstr;

my $errorcount = 0;

foreach (@lines)

{

@@ -193,6 +193,7 @@ my $stmt = "INSERT OR REPLACE INTO photos (file, maker, model, lensmake, lens, focallength, focallength35mm, aperture, exposuretime, iso, flash, datetimeoriginal)

VALUES ('$file', '$maker', '$model', '$lensmake', '$lens', '$fl', '$fl35', '$apert', '$exposuretime', '$iso', '$flash', '$datetimeoriginal')";

my $rv = $dbh->do($stmt) or $errorcount++;

}

+ $dbh->commit();

$dbh->disconnect();

say sprintf('%5d', $errorcount). ' image files skipped due to errors';

say "Updated database $opt_D.";