From: Sven Schöling Date: Thu, 8 Sep 2016 14:50:31 +0000 (+0200) Subject: GL: single-dbh disconnects X-Git-Tag: release-3.5.4~2048 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=20fb55232330b0c1d0353bb2db0e85003153113e;p=kivitendo-erp.git GL: single-dbh disconnects --- diff --git a/SL/GL.pm b/SL/GL.pm index 1b71c9440..1d3065c2a 100644 --- a/SL/GL.pm +++ b/SL/GL.pm @@ -217,8 +217,7 @@ sub all_transactions { my ($self, $myconfig, $form) = @_; $main::lxdebug->enter_sub(); - # connect to database - my $dbh = $form->dbconnect($myconfig); + my $dbh = SL::DB->client->dbh; my ($query, $sth, $source, $null, $space); my ($glwhere, $arwhere, $apwhere) = ("1 = 1", "1 = 1", "1 = 1"); @@ -617,8 +616,6 @@ sub all_transactions { ($form->{account_description}) = selectrow_query($form, $dbh, $query, $form->{accno}); } - $dbh->disconnect; - $main::lxdebug->leave_sub(); } @@ -628,8 +625,7 @@ sub transaction { my ($query, $sth, $ref, @values); - # connect to database - my $dbh = $form->dbconnect($myconfig); + my $dbh = SL::DB->client->dbh; $query = qq|SELECT closedto, revtrans FROM defaults|; ($form->{closedto}, $form->{revtrans}) = selectrow_query($form, $dbh, $query); @@ -701,8 +697,6 @@ sub transaction { ORDER BY c.accno|; $form->{chart} = selectall_hashref_query($form, $dbh, $query, conv_date($form->{transdate})); - $dbh->disconnect; - $main::lxdebug->leave_sub(); }