summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2006-09-14 05:51:31 +0000
committereinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2006-09-14 05:51:31 +0000
commit0c897b2d198337f330de6253c6bcba35bedaeb2c (patch)
tree8b1f9981b42bd9377ec8e574b75cfa6f1b18c84c
parentc3424f9e3869dce59cfeeea95e0de3856640b440 (diff)
Made db updates use transactions.
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@89 4979c152-3d1c-0410-bac9-87ea11338e46
-rwxr-xr-xLedgerSMB/User.pm4
1 files changed, 2 insertions, 2 deletions
diff --git a/LedgerSMB/User.pm b/LedgerSMB/User.pm
index a5e0547a..d0ccfc61 100755
--- a/LedgerSMB/User.pm
+++ b/LedgerSMB/User.pm
@@ -613,7 +613,7 @@ sub dbupdate {
$db =~ s/^db//;
&dbconnect_vars($form, $db);
- my $dbh = DBI->connect($form->{dbconnect}, $form->{dbuser}, $form->{dbpasswd}) or $form->dberror;
+ my $dbh = DBI->connect($form->{dbconnect}, $form->{dbuser}, $form->{dbpasswd}, {AutoCommit => 0}) or $form->dberror;
# check version
$query = qq|SELECT version FROM defaults|;
@@ -644,7 +644,7 @@ sub dbupdate {
# apply upgrade
$self->process_query($form, $dbh, "sql/$upgradescript");
-
+ $dbh->commit;
$version = $maxdb;
}