jgallagher has asked for the wisdom of the Perl Monks concerning the following question:
Here is the relavent code in the class:DBI connect('database','username',...) failed: Too many connections
The subclasses do not redefine cgiapp_init or teardown, and I can die in the teardown method, so I know it's getting to it. But apparently it's not disconnecting for some reason, unless somebody has any ideas on where else the problem might be. I've tried this with and without Apache::DBI.sub cgiapp_init { my $self = shift; # ...some unrelated code... my $dbh = DBI->connect('dbi:mysql:database', 'user', 'password', { RaiseError => 1 } ) or die $DBI::errstr; # ...more code... $self->param('dbh' => $dbh); } sub teardown { my $self = shift; $self->param('dbh')->disconnect() or die $self->param('dbh')->errs +tr; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: CGI::Application not disconnecting from the database?
by lestrrat (Deacon) on May 08, 2003 at 08:04 UTC | |
|
Re: CGI::Application not disconnecting from the database?
by CountZero (Bishop) on May 08, 2003 at 15:16 UTC | |
by jgallagher (Pilgrim) on May 08, 2003 at 16:12 UTC | |
by CountZero (Bishop) on May 08, 2003 at 21:03 UTC | |
|
Re: CGI::Application not disconnecting from the database?
by Anonymous Monk on May 08, 2003 at 19:42 UTC |