From d57c45b55f6365773a7a326d8c724b0ff0950889 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Tue, 24 May 2011 18:56:10 +0200 Subject: [PATCH] =?utf8?q?Drafts:=20dbconnects=20in=20get=5Fstandard=5Fdbh?= =?utf8?q?=20ge=C3=A4ndert.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/Drafts.pm | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) 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(); } -- 2.20.1