Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: ModPerl: ModPerl
Re: Lost connection to MySQL server during query (was "Segfault when connecting during Apache startup")
 

Index | Next | Previous | View Flat


list at funkreich

Jun 30, 2008, 6:28 AM


Views: 1972
Permalink
Re: Lost connection to MySQL server during query (was "Segfault when connecting during Apache startup")

Quoting Perrin Harkins <perrin[at]elem.com>:
> On Mon, Jun 30, 2008 at 4:54 AM, Tobias Kremer <list[at]funkreich.de> wrote:
> > We never fork and I thought that Apache::DBI takes care of checking if a
> > connection went stale by utilizing DBI's/DBD::mysql's ping() method?
> It does, but it can't stop you from doing things like putting a
> database handle in a global during startup and trying to use it later.

Ok, I narrowed it down to the database connection initiated during server
startup. As soon as I remove it the errors vanish completely. But I don't
understand why this is causing a problem because Apache::DBI is supposed to not
cache connections made during server startup - it even correctly issues a
warning.

Here are some snippets to illustrate what I'm doing:

-----------------------------------
ApacheHandler.pm
-----------------------------------
use Apache::DBI;
{
package HTML::Mason::Commands;
use vars qw/ $thefoo /;
}
my $foo = My::Foo->new();
sub handler {
$HTML::Mason::Commands::thefoo = $foo;
}

-----------------------------------
My/Foo.pm
-----------------------------------
sub new {
my $dbh = My::Database::dbh();
my $result = $dbh->selectall_arrayref( ... );
# create an object of e.g. My::Bar initialized with row data
# and store it in $self. $dbh is never stored somewhere!
$dbh->disconnect();
}

-----------------------------------
My/Database.pm
-----------------------------------
use DBI;
sub dbh { DBI->connect( ... ) }


Any ideas? Thanks a lot!

--Tobias

Subject User Time
Re: Lost connection to MySQL server during query (was "Segfault when connecting during Apache startup") list at funkreich Jun 30, 2008, 6:28 AM
    Re: Lost connection to MySQL server during query (was "Segfault when connecting during Apache startup") perrin at elem Jun 30, 2008, 6:37 AM
    Re: Lost connection to MySQL server during query (was "Segfault when connecting during Apache startup") list at funkreich Jun 30, 2008, 7:34 AM
        Re: Lost connection to MySQL server during query (was "Segfault when connecting during Apache startup") mpeters at plusthree Jun 30, 2008, 7:42 AM
            Re: Lost connection to MySQL server during query (was "Segfault when connecting during Apache startup") list at funkreich Jun 30, 2008, 8:02 AM
                Re: Lost connection to MySQL server during query (was "Segfault when connecting during Apache startup") perrin at elem Jun 30, 2008, 8:10 AM
                Re: Lost connection to MySQL server during query (was "Segfault when connecting during Apache startup") mpeters at plusthree Jun 30, 2008, 8:15 AM
    Re: Lost connection to MySQL server during query (was "Segfault when connecting during Apache startup") list at funkreich Jun 30, 2008, 10:40 AM
        Re: Lost connection to MySQL server during query (was "Segfault when connecting during Apache startup") perrin at elem Jun 30, 2008, 2:27 PM
    Re: Lost connection to MySQL server during query (was "Segfault when connecting during Apache startup") list at funkreich Jul 1, 2008, 12:42 AM
        Re: Lost connection to MySQL server during query (was "Segfault when connecting during Apache startup") perrin at elem Jul 1, 2008, 6:34 AM
    Re: Lost connection to MySQL server during query (was "Segfault when connecting during Apache startup") list at funkreich Jul 1, 2008, 6:56 AM
        Re: Lost connection to MySQL server during query (was "Segfault when connecting during Apache startup") perrin at elem Jul 1, 2008, 6:56 AM
    Re: Lost connection to MySQL server during query (was "Segfault when connecting during Apache startup") list at funkreich Jul 1, 2008, 7:08 AM
        Re: Lost connection to MySQL server during query (was "Segfault when connecting during Apache startup") perrin at elem Jul 1, 2008, 10:21 AM
    Re: Lost connection to MySQL server during query (was "Segfault when connecting during Apache startup") list at funkreich Jul 2, 2008, 1:03 AM
        Re: Lost connection to MySQL server during query (was "Segfault when connecting during Apache startup") list at funkreich Jul 2, 2008, 2:12 AM
            Re: Lost connection to MySQL server during query (was "Segfault when connecting during Apache startup") perrin at elem Jul 2, 2008, 11:08 AM
    Re: Lost connection to MySQL server during query (was "Segfault when connecting during Apache startup") list at funkreich Jul 3, 2008, 12:40 AM

  Index | Next | Previous | View Flat
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.