From d38eaef8d62fc0826fa963c0ebea4fced33f5410 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Mon, 15 Aug 2016 14:57:33 +0200 Subject: [PATCH] dbconnect_noauto entfernt --- SL/RC.pm | 8 ++------ SL/RP.pm | 8 ++------ SL/User.pm | 3 ++- bin/mozilla/gl.pl | 6 ++---- 4 files changed, 8 insertions(+), 17 deletions(-) diff --git a/SL/RC.pm b/SL/RC.pm index 8447bb8a6..1ccf7ab9e 100644 --- a/SL/RC.pm +++ b/SL/RC.pm @@ -64,7 +64,7 @@ sub payment_transactions { my ($self, $myconfig, $form) = @_; # connect to database, turn AutoCommit off - my $dbh = $form->dbconnect_noauto($myconfig); + my $dbh = SL::DB->client->dbh; my ($query, @values); @@ -215,8 +215,6 @@ sub payment_transactions { $form->{PR} = selectall_hashref_query($form, $dbh, $query, @values); - $dbh->disconnect; - $main::lxdebug->leave_sub(); } @@ -259,7 +257,7 @@ sub get_statement_balance { my ($self, $myconfig, $form) = @_; # connect to database, turn AutoCommit off - my $dbh = $form->dbconnect_noauto($myconfig); + my $dbh = SL::DB->client->dbh; my ($query, @values); @@ -277,8 +275,6 @@ sub get_statement_balance { ($form->{statement_balance}) = selectrow_query($form, $dbh, $query, @values); - $dbh->disconnect; - $main::lxdebug->leave_sub(); } diff --git a/SL/RP.pm b/SL/RP.pm index fbfd4746a..425dfa1c2 100644 --- a/SL/RP.pm +++ b/SL/RP.pm @@ -1465,7 +1465,7 @@ sub paymentaccounts { my ($self, $myconfig, $form) = @_; # connect to database, turn AutoCommit off - my $dbh = $form->dbconnect_noauto($myconfig); + my $dbh = SL::DB->client->dbh; my $ARAP = $form->{db} eq "ar" ? "AR" : "AP"; @@ -1476,8 +1476,6 @@ sub paymentaccounts { WHERE link LIKE '%${ARAP}_paid%'|; $form->{PR} = selectall_hashref_query($form, $dbh, $query); - $dbh->disconnect; - $main::lxdebug->leave_sub(); } @@ -1487,7 +1485,7 @@ sub payments { my ($self, $myconfig, $form) = @_; # connect to database, turn AutoCommit off - my $dbh = $form->dbconnect_noauto($myconfig); + my $dbh = SL::DB->client->dbh; my $ml = 1; my $arap; @@ -1608,8 +1606,6 @@ sub payments { $sth_details->finish(); } - $dbh->disconnect; - $main::lxdebug->leave_sub(); } diff --git a/SL/User.pm b/SL/User.pm index 2c6285599..6d671c4bd 100644 --- a/SL/User.pm +++ b/SL/User.pm @@ -37,6 +37,7 @@ package User; use IO::File; use Fcntl qw(:seek); +use SL::DB; #use SL::Auth; use SL::DB::AuthClient; use SL::DB::Employee; @@ -113,7 +114,7 @@ sub login { return LOGIN_AUTH_DBUPDATE_AVAILABLE() if $dbupdater_auth->unapplied_upgrade_scripts($::auth->dbconnect); # check if database is down - my $dbh = $form->dbconnect_noauto; + my $dbh = SL::DB->client->dbh; # we got a connection, check the version my ($dbversion) = $dbh->selectrow_array(qq|SELECT version FROM defaults|); diff --git a/bin/mozilla/gl.pl b/bin/mozilla/gl.pl index b033f0e62..ea94a28be 100644 --- a/bin/mozilla/gl.pl +++ b/bin/mozilla/gl.pl @@ -528,10 +528,9 @@ sub update { my $creditcount = 0; my ($debitcredit, $amount); - my $dbh = $form->dbconnect_noauto(\%myconfig); + my $dbh = SL::DB->client->dbh; my ($notax_id) = selectrow_query($form, $dbh, "SELECT id FROM tax WHERE taxkey = 0 LIMIT 1", ); my $zerotaxes = selectall_hashref_query($form, $dbh, "SELECT id FROM tax WHERE rate = 0", ); - $dbh->disconnect; my @flds = qw(accno debit credit projectnumber fx_transaction source memo tax taxchart); @@ -998,10 +997,9 @@ sub post_transaction { my $debitcredit; my %split_safety = (); - my $dbh = $form->dbconnect_noauto(\%myconfig); + my $dbh = SL::DB->client->dbh; my ($notax_id) = selectrow_query($form, $dbh, "SELECT id FROM tax WHERE taxkey = 0 LIMIT 1", ); my $zerotaxes = selectall_hashref_query($form, $dbh, "SELECT id FROM tax WHERE rate = 0", ); - $dbh->disconnect; my @flds = qw(accno debit credit projectnumber fx_transaction source memo tax taxchart); -- 2.20.1