Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision ef058994

Von Sven Schöling vor etwa 8 Jahren hinzugefügt

  • ID ef05899434f409d342d0574e2af82d80cab37eda
  • Vorgänger cafc615b
  • Nachfolger ce52db90

RP: single-dbh disconnects

Unterschiede anzeigen:

SL/RP.pm
38 38
use Data::Dumper;
39 39
use SL::DB::Helper::AccountingPeriod qw(get_balance_starting_date);
40 40
use List::Util qw(sum);
41
use SL::DB;
41 42

  
42 43
# use warnings;
43 44
use strict;
......
660 661

  
661 662
  my ($self, $myconfig, $form, %options) = @_;
662 663

  
663
  my $dbh = $form->dbconnect($myconfig);
664
  my $dbh = SL::DB->client->dbh;
664 665

  
665 666
  my ($query, $sth, $ref);
666 667
  my %balance = ();
......
1162 1163

  
1163 1164
  }
1164 1165

  
1165
  $dbh->disconnect;
1166

  
1167 1166
  # debits and credits for headings
1168 1167
  foreach my $accno (@headingaccounts) {
1169 1168
    foreach $ref (@{ $form->{TB} }) {
......
1200 1199
  my ($self, $myconfig, $form) = @_;
1201 1200

  
1202 1201
  # connect to database
1203
  my $dbh     = $form->dbconnect($myconfig);
1202
  my $dbh     = SL::DB->client->dbh;
1204 1203

  
1205 1204
  my ($invoice, $arap, $buysell, $ct, $ct_id, $ml);
1206 1205

  
......
1332 1331

  
1333 1332
  $sth->finish;
1334 1333

  
1335
  # disconnect
1336
  $dbh->disconnect;
1337

  
1338 1334
  $main::lxdebug->leave_sub();
1339 1335
}
1340 1336

  
......
1343 1339

  
1344 1340
  my ($self, $myconfig, $form) = @_;
1345 1341

  
1346
  # connect to database
1347
  my $dbh = $form->dbconnect($myconfig);
1342
  my $dbh = SL::DB->client->dbh;
1348 1343

  
1349 1344
  my $ct = $form->{ct} eq "customer" ? "customer" : "vendor";
1350 1345

  
......
1354 1349
       WHERE ct.id = ?|;
1355 1350
  ($form->{ $form->{ct} }, $form->{email}, $form->{cc}, $form->{bcc}) =
1356 1351
    selectrow_query($form, $dbh, $query, $form->{"${ct}_id"});
1357
  $dbh->disconnect;
1358 1352

  
1359 1353
  $main::lxdebug->leave_sub();
1360 1354
}
......
1364 1358

  
1365 1359
  my ($self, $myconfig, $form) = @_;
1366 1360

  
1367
  # connect to database
1368
  my $dbh = $form->dbconnect($myconfig);
1361
  my $dbh = SL::DB->client->dbh;
1369 1362

  
1370 1363
  my ($null, $department_id) = split /--/, $form->{department};
1371 1364

  
......
1454 1447

  
1455 1448
  $form->{TR} = selectall_hashref_query($form, $dbh, $query);
1456 1449

  
1457
  $dbh->disconnect;
1458

  
1459 1450
  $main::lxdebug->leave_sub();
1460 1451
}
1461 1452

  
......
1614 1605

  
1615 1606
  my ($self, $myconfig, $form) = @_;
1616 1607

  
1617
  # connect to database
1618
  my $dbh = $form->dbconnect($myconfig);
1608
  my $dbh = SL::DB->client->dbh;
1619 1609

  
1620 1610
  my $last_period = 0;
1621 1611
  my $category;
......
1815 1805
    }
1816 1806

  
1817 1807
  }
1818
  $dbh->disconnect;
1819 1808

  
1820 1809
  $main::lxdebug->leave_sub();
1821 1810
}

Auch abrufbar als: Unified diff