[interchange-cvs] interchange - heins modified lib/Vend/Server.pm

interchange-cvs at icdevgroup.org interchange-cvs at icdevgroup.org
Sun Jun 27 15:02:27 EDT 2004


User:      heins
Date:      2004-06-27 19:02:27 GMT
Modified:  lib/Vend Server.pm
Log:
* Completely remove all DBI cache entries when in PreFork mode, so
  that we won't have "MySQL server gone away" errors.

  It doesn't make too much sense to cache connections anymore, anyway,
  as DBI does that for you.

Revision  Changes    Path
2.55      +11 -7     interchange/lib/Vend/Server.pm


rev 2.55, prev_rev 2.54
Index: Server.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/Server.pm,v
retrieving revision 2.54
retrieving revision 2.55
diff -u -r2.54 -r2.55
--- Server.pm	8 Jun 2004 03:03:01 -0000	2.54
+++ Server.pm	27 Jun 2004 19:02:27 -0000	2.55
@@ -1,6 +1,6 @@
 # Vend::Server - Listen for Interchange CGI requests as a background server
 #
-# $Id: Server.pm,v 2.54 2004/06/08 03:03:01 jon Exp $
+# $Id: Server.pm,v 2.55 2004/06/27 19:02:27 mheins Exp $
 #
 # Copyright (C) 2002-2003 Interchange Development Group
 # Copyright (C) 1996-2002 Red Hat, Inc.
@@ -26,7 +26,7 @@
 package Vend::Server;
 
 use vars qw($VERSION);
-$VERSION = substr(q$Revision: 2.54 $, 10);
+$VERSION = substr(q$Revision: 2.55 $, 10);
 
 use POSIX qw(setsid strftime);
 use Vend::Util;
@@ -857,9 +857,9 @@
 sub connection {
     my (%env, $entity);
 
-	# This resets all $Vend::variable settings so we start
-	# completely initialized. It only affects the Vend and CGI packages,
-	# not any Vend::XXX packages.
+  ### This resets all $Vend::variable settings so we start
+  ### completely initialized. It only affects the Vend package,
+  ### not any Vend::XXX packages.
 	reset_vars();
 
 	if($Global::ShowTimes) {
@@ -945,13 +945,17 @@
 	package CGI;
 	reset 'A-Z';
 	reset 'a-z';
+	undef %Vend::Table::DBI::DBI_connect_cache;
+	undef %Vend::Table::DBI::DBI_connect_bad;
+	undef %Vend::Table::DBI::DBI_connect_count;
 	srand();
 #::logDebug("Reset vars");
 }
 
 sub reset_per_fork {
-	%Vend::Table::DBI::DBI_connect_cache = ();
-	%Vend::Table::DBI::DBI_connect_bad = ();
+	undef %Vend::Table::DBI::DBI_connect_cache;
+	undef %Vend::Table::DBI::DBI_connect_bad;
+	undef %Vend::Table::DBI::DBI_connect_count;
 }
 
 sub clean_up_after_fork {








More information about the interchange-cvs mailing list