perlquestion
expresspotato
Hey,
$dbh->disconnect; For some reason isn't working for me... Take the following example:
<code>
use DBI;
#do("./sql.pl");
print `netstat | grep "mysql" | wc -l`;
$db="billing";
$user="user";
$passwd="me";
$host="localhost:3306";
$connectionInfo="dbi:mysql:$db;$host";
$select = "select id from sometable;";
$dbh=DBI->connect($connectionInfo,$user,$passwd) || print "DBI Connection Failed!($DBI::errstr)";
$sth=$dbh->prepare($select);
if (!($sth->execute())) {
}
@row=$sth->fetchrow_array();
$sth->finish;
$dbh->disconnect;
print `netstat | grep "mysql" | wc -l`;
</code>
It will print the number of mysql connections before and after the script is run. Continually running it you can see the number active connections increases with each run.
The connections do eventually time out but that's no help at all. Considering a server could try and handle thousands of requests, without them being disconnected (on demand) the server would quickly grind to a halt.
Any help would be appreciated!
-Kevin