From 0c897b2d198337f330de6253c6bcba35bedaeb2c Mon Sep 17 00:00:00 2001 From: einhverfr Date: Thu, 14 Sep 2006 05:51:31 +0000 Subject: Made db updates use transactions. git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@89 4979c152-3d1c-0410-bac9-87ea11338e46 --- LedgerSMB/User.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'LedgerSMB') 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; } -- cgit v1.2.3