From: Sven Schöling Date: Thu, 8 Sep 2016 14:49:03 +0000 (+0200) Subject: CA: single-dbh disconnects X-Git-Tag: release-3.5.4~2053 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=99ae850764606d3b4e30519b8131b5e074a8fc29;p=kivitendo-erp.git CA: single-dbh disconnects --- diff --git a/SL/CA.pm b/SL/CA.pm index 2c4c221e4..d9fa677a6 100644 --- a/SL/CA.pm +++ b/SL/CA.pm @@ -40,6 +40,7 @@ use strict; package CA; use Data::Dumper; use SL::DBUtils; +use SL::DB; sub all_accounts { $main::lxdebug->enter_sub(); @@ -49,7 +50,7 @@ sub all_accounts { my (%amount, $acc_cash_where); # connect to database - my $dbh = $form->dbconnect($myconfig); + my $dbh = SL::DB->client->dbh; # bug 1071 Warum sollte bei Erreichen eines neuen Jahres die Kontenübersicht nur noch die # bereits bebuchten Konten anzeigen? @@ -134,7 +135,6 @@ sub all_accounts { } $sth->finish; - $dbh->disconnect; $main::lxdebug->leave_sub(); } @@ -144,8 +144,7 @@ sub all_transactions { my ($self, $myconfig, $form) = @_; - # connect to database - my $dbh = $form->dbconnect($myconfig); + my $dbh = SL::DB->client->dbh; # get chart_id my $query = qq|SELECT id FROM chart WHERE accno = ?|; @@ -424,7 +423,6 @@ sub all_transactions { } $sth->finish; - $dbh->disconnect; $main::lxdebug->leave_sub(); }