Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 50aca900

Von Sven Schöling vor mehr als 11 Jahren hinzugefügt

  • ID 50aca900c2d569194e1718c1da9d1062dda9fd68
  • Vorgänger 85724239
  • Nachfolger c85291ee

Datenbankhandles in IC nicht disconnecten

Unterschiede anzeigen:

SL/IC.pm
50 50
  my ($self, $myconfig, $form) = @_;
51 51

  
52 52
  # connect to db
53
  my $dbh = $form->dbconnect($myconfig);
53
  my $dbh = $form->get_standard_dbh;
54 54

  
55 55
  my $sth;
56 56

  
......
176 176

  
177 177
  $form->{"unit_changeable"} = $form->{orphaned};
178 178

  
179
  $dbh->disconnect;
179
  Common::webdav_folder($form) if $::lx_office_conf{features}{webdav};
180 180

  
181 181
  $main::lxdebug->leave_sub();
182 182
}
......
186 186

  
187 187
  my ($self, $myconfig, $form) = @_;
188 188

  
189
  my $dbh = $form->dbconnect($myconfig);
189
  my $dbh = $form->get_standard_dbh;
190 190

  
191 191
  # get pricegroups
192 192
  my $query = qq|SELECT id, pricegroup FROM pricegroup ORDER BY lower(pricegroup)|;
......
204 204
  #correct rows
205 205
  $form->{price_rows} = $i - 1;
206 206

  
207
  $dbh->disconnect;
208

  
209 207
  $main::lxdebug->leave_sub();
210 208

  
211 209
  return $pricegroups;
......
218 216

  
219 217
  my ($query, $sth);
220 218

  
221
  my $dbh = $form->dbconnect($myconfig);
219
  my $dbh = $form->get_standard_dbh;
222 220

  
223 221
  # get buchungsgruppen
224 222
  $query = qq|SELECT id, description FROM buchungsgruppen ORDER BY sortkey|;
......
551 549
  my ($self, $myconfig, $form) = @_;
552 550

  
553 551
  # connect to database
554
  my $dbh = $form->dbconnect($myconfig);
552
  my $dbh = $form->get_standard_dbh;
555 553

  
556 554
  my $where = qq|NOT p.obsolete|;
557 555
  my @values;
......
578 576

  
579 577
  $form->{assembly_items} = selectall_hashref_query($form, $dbh, $query, @values);
580 578

  
581
  $dbh->disconnect;
582

  
583 579
  $main::lxdebug->leave_sub();
584 580
}
585 581

  
......
589 585
  my ($self, $myconfig, $form) = @_;
590 586
  my @values = (conv_i($form->{id}));
591 587
  # connect to database, turn off AutoCommit
592
  my $dbh = $form->dbconnect_noauto($myconfig);
588
  my $dbh = $form->get_standard_dbh;
593 589

  
594 590
  my %columns = ( "assembly" => "id", "parts" => "id" );
595 591

  
......
600 596

  
601 597
  # commit
602 598
  my $rc = $dbh->commit;
603
  $dbh->disconnect;
604 599

  
605 600
  $main::lxdebug->leave_sub();
606 601

  
......
643 638
  }
644 639

  
645 640
  # connect to database
646
  my $dbh = $form->dbconnect($myconfig);
641
  my $dbh = $form->get_standard_dbh;
647 642

  
648 643
  my $query =
649 644
    qq|SELECT p.id, p.partnumber, p.description, p.sellprice,
......
655 650
       WHERE $where|;
656 651
  $form->{item_list} = selectall_hashref_query($form, $dbh, $query, @values);
657 652

  
658
  $dbh->disconnect;
659

  
660 653
  $main::lxdebug->leave_sub();
661 654
}
662 655

  
......
1203 1196
  my $num_updated = 0;
1204 1197

  
1205 1198
  # connect to database
1206
  my $dbh = $form->dbconnect_noauto($myconfig);
1199
  my $dbh = $form->get_standard_dbh;
1207 1200

  
1208 1201
  for my $column (qw(sellprice listprice)) {
1209 1202
    next if ($form->{$column} eq "");
......
1264 1257
  $sth_multiply->finish();
1265 1258

  
1266 1259
  my $rc= $dbh->commit;
1267
  $dbh->disconnect;
1268 1260

  
1269 1261
  $main::lxdebug->leave_sub();
1270 1262

  
......
1277 1269
  my ($self, $module, $myconfig, $form) = @_;
1278 1270

  
1279 1271
  # connect to database
1280
  my $dbh = $form->dbconnect($myconfig);
1272
  my $dbh = $form->get_standard_dbh;
1281 1273

  
1282 1274
  my @values = ('%' . $module . '%');
1283 1275
  my $query;
......
1333 1325
    ($form->{priceupdate}) = selectrow_query($form, $dbh, qq|SELECT current_date|);
1334 1326
  }
1335 1327

  
1336
  $dbh->disconnect;
1337 1328
  $main::lxdebug->leave_sub();
1338 1329
}
1339 1330

  
......
1342 1333
  $main::lxdebug->enter_sub();
1343 1334

  
1344 1335
  my ($self, $myconfig, $form, $sortorder) = @_;
1345
  my $dbh   = $form->dbconnect($myconfig);
1336
  my $dbh   = $form->get_standard_dbh;
1346 1337
  my $order = qq| p.partnumber|;
1347 1338
  my $where = qq|1 = 1|;
1348 1339
  my @values;
......
1385 1376
  }    #while
1386 1377
  $form->{rows} = $j;
1387 1378
  $sth->finish;
1388
  $dbh->disconnect;
1389 1379

  
1390 1380
  $main::lxdebug->leave_sub();
1391 1381

  
......
1413 1403
  my ($self, $myconfig, $form) = @_;
1414 1404

  
1415 1405
  # connect to database
1416
  my $dbh = $form->dbconnect($myconfig);
1406
  my $dbh = $form->get_standard_dbh;
1417 1407

  
1418 1408
  my @values;
1419 1409
  my $where;
......
1435 1425

  
1436 1426
  my $languages = selectall_hashref_query($form, $dbh, $query, @values);
1437 1427

  
1438
  $dbh->disconnect;
1439

  
1440 1428
  $main::lxdebug->leave_sub();
1441 1429

  
1442 1430
  return $languages;

Auch abrufbar als: Unified diff