Nach jedem Request die Standard-Datenbankverbindung schließen
authorMoritz Bunkus <m.bunkus@linet-services.de>
Mon, 1 Feb 2010 11:12:19 +0000 (12:12 +0100)
committerSven Schöling <s.schoeling@linet-services.de>
Tue, 20 Jul 2010 08:25:11 +0000 (10:25 +0200)
SL/Dispatcher.pm
SL/Form.pm

index 44bf3be..2599f5f 100644 (file)
@@ -179,6 +179,7 @@ sub handle_request {
   $::locale   = undef;
   $::form     = undef;
   $::myconfig = ();
+  Form::disconnect_standard_dbh();
 
   $::lxdebug->end_request;
   $::lxdebug->leave_sub;
index 130a337..cfffd78 100644 (file)
@@ -63,10 +63,13 @@ use strict;
 my $standard_dbh;
 
 END {
-  if ($standard_dbh) {
-    $standard_dbh->disconnect();
-    undef $standard_dbh;
-  }
+  disconnect_standard_dbh();
+}
+
+sub disconnect_standard_dbh {
+  return unless $standard_dbh;
+  $standard_dbh->disconnect();
+  undef $standard_dbh;
 }
 
 sub _store_value {