From: Sven Schöling Date: Tue, 24 May 2011 16:56:10 +0000 (+0200) Subject: Drafts: dbconnects in get_standard_dbh geändert. X-Git-Tag: release-2.6.3~25^2~10 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=d57c45b55f6365773a7a326d8c724b0ff0950889;p=kivitendo-erp.git Drafts: dbconnects in get_standard_dbh geändert. --- diff --git a/SL/Drafts.pm b/SL/Drafts.pm index 891775bc0..4a29b1925 100644 --- a/SL/Drafts.pm +++ b/SL/Drafts.pm @@ -45,7 +45,8 @@ sub save { my ($dbh, $sth, $query, %saved, $dumped); - $dbh = $form->dbconnect_noauto($myconfig); + $dbh = $form->get_standard_dbh; + $dbh->begin_work; my ($module, $submodule) = $self->get_module($form); @@ -72,7 +73,6 @@ sub save { do_query($form, $dbh, $query, $draft_description, $dumped, $form->{login}, $draft_id); $dbh->commit(); - $dbh->disconnect(); $form->{draft_id} = $draft_id; $form->{draft_description} = $draft_description; @@ -87,7 +87,7 @@ sub load { my ($dbh, $sth, $query, @values); - $dbh = $form->dbconnect($myconfig); + $dbh = $form->get_standard_dbh; $query = qq|SELECT id, description, form FROM drafts WHERE id = ?|; @@ -98,8 +98,6 @@ sub load { } $sth->finish(); - $dbh->disconnect(); - $main::lxdebug->leave_sub(); return @values; @@ -114,13 +112,11 @@ sub remove { my ($dbh, $sth, $query); - $dbh = $form->dbconnect($myconfig); + $dbh = $form->get_standard_dbh; $query = qq|DELETE FROM drafts WHERE id IN (| . join(", ", map { "?" } @draft_ids) . qq|)|; do_query($form, $dbh, $query, @draft_ids); - $dbh->disconnect(); - $main::lxdebug->leave_sub(); }