Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision fcbc7009

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

  • ID fcbc700916d7cee50c7befdf2c4757e421b4dcc2
  • Vorgänger 582dc2d8
  • Nachfolger a84085ef

Common: single-dbh disconnects

Unterschiede anzeigen:

SL/Common.pm
55 55

  
56 56
  my ($self, $myconfig, $form, $order_by, $order_dir) = @_;
57 57

  
58
  my $dbh = $form->dbconnect($myconfig);
58
  my $dbh = SL::DB->client->dbh;
59 59

  
60 60
  my (@filter_values, $filter);
61 61

  
......
94 94
    push(@{$parts}, $ref);
95 95
  }
96 96
  $sth->finish();
97
  $dbh->disconnect();
98 97

  
99 98
  $main::lxdebug->leave_sub();
100 99

  
......
106 105

  
107 106
  my ($self, $myconfig, $form, $order_by, $order_dir, $is_vendor, $allow_both) = @_;
108 107

  
109
  my $dbh = $form->dbconnect($myconfig);
108
  my $dbh = SL::DB->client->dbh;
110 109

  
111 110
  my (@filter_values, $filter);
112 111
  if ($form->{"name"}) {
......
157 156
    push(@{$customers}, $ref);
158 157
  }
159 158
  $sth->finish();
160
  $dbh->disconnect();
161 159

  
162 160
  $main::lxdebug->leave_sub();
163 161

  
......
169 167

  
170 168
  my ($self, $myconfig, $form, $order_by, $order_dir) = @_;
171 169

  
172
  my $dbh = $form->dbconnect($myconfig);
170
  my $dbh = SL::DB->client->dbh;
173 171

  
174 172
  my (@filter_values, $filter);
175 173
  if ($form->{"name"}) {
......
193 191
    push(@{$delivery_customers}, $ref);
194 192
  }
195 193
  $sth->finish();
196
  $dbh->disconnect();
197 194

  
198 195
  $main::lxdebug->leave_sub();
199 196

  
......
205 202

  
206 203
  my ($self, $myconfig, $form, $order_by, $order_dir) = @_;
207 204

  
208
  my $dbh = $form->dbconnect($myconfig);
205
  my $dbh = SL::DB->client->dbh;
209 206

  
210 207
  my (@filter_values, $filter);
211 208
  if ($form->{"name"}) {
......
229 226
    push(@{$vendors}, $ref);
230 227
  }
231 228
  $sth->finish();
232
  $dbh->disconnect();
233 229

  
234 230
  $main::lxdebug->leave_sub();
235 231

  
......
315 311

  
316 312
  $vc = $vc eq "customer" ? "customer" : "vendor";
317 313

  
318
  my $dbh = $form->dbconnect($myconfig);
314
  my $dbh = SL::DB->client->dbh;
319 315

  
320 316
  my $query;
321 317

  
......
335 331
  my $ref = selectfirst_hashref_query($form, $dbh, $query, $vc_id);
336 332

  
337 333
  if (!$ref) {
338
    $dbh->disconnect();
339 334
    $main::lxdebug->leave_sub();
340 335
    return 0;
341 336
  }
......
353 348
  # Only show default pricegroup for customer, not vendor, which is why this is outside the main query
354 349
  ($form->{pricegroup}) = selectrow_query($form, $dbh, qq|SELECT pricegroup FROM pricegroup WHERE id = ?|, $form->{pricegroup_id});
355 350

  
356
  $dbh->disconnect();
357

  
358 351
  $main::lxdebug->leave_sub();
359 352

  
360 353
  return 1;
......
367 360

  
368 361
  $prefix ||= "";
369 362

  
370
  my $dbh = $form->dbconnect($myconfig);
363
  my $dbh = SL::DB->client->dbh;
371 364

  
372 365
  my $query = qq|SELECT * FROM shipto WHERE shipto_id = ?|;
373 366
  my $ref   = selectfirst_hashref_query($form, $dbh, $query, $shipto_id);
......
381 374
  );
382 375
  $form->{"${prefix}shiptocvar_$_->{name}"} = $_->{value} for @{ $cvars };
383 376

  
384
  $dbh->disconnect();
385

  
386 377
  $main::lxdebug->leave_sub();
387 378
}
388 379

  

Auch abrufbar als: Unified diff