in reply to Search engine code critique
The lack of $dbh->disconnect is a potential disaster waiting to happen. Don't know what the SQL server defaults are but by default MySQL will accept 100 connections that will persist for 8 hours. Although it surprised me undefing $dbh (ie when the script finishes) does not cause a DESTROY{ ..disconnect .. ) to be called allowing the connections to persist and accumulate.....until it falls over with a too many connections error. This particular error often goes unnoticed until you get real load on a widget.
One way to code it to make sure this does not happen is
my $sth; my $dbh->connect(...... END{ $sth->finish if $sth; $dbh->disconnect if $dbh } # now do whatever
cheers
tachyon
s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Search engine code critique
by bean (Monk) on Sep 19, 2003 at 03:26 UTC | |
by tachyon (Chancellor) on Sep 19, 2003 at 12:33 UTC | |
by bean (Monk) on Sep 19, 2003 at 19:47 UTC |