this is my test program:
what I found out is, if I turne the buffered log on for the database, it leaks out
30 Megs when it is done, but if I turn off the logging for the informix db, it only
leaks out a few megs, which I can't be sure either since I have other programs on
the machine.
What I have in production is much more complicated and leaks out a lot more in
a lot shorter time.
any ideas guys?
thanks
yan
#!/usr/bin/perl
use DBI;
&connectpdqdb();
&preparepdqsql();
for ($i=1;$i<=100000;$i++) {
print ("doing $i\n");
&addvehicle();
&adddriver();
}
&disconnectpdqdb();
sub connectpdqdb {
$dbh = DBI->connect( 'pdqtest', 'informix', 'informix', 'Informix' );
if ( !defined $dbh ) {
die "Cannot connect to Informix server: $DBI::errstr\n";
}
}
sub disconnectpdqdb {
$sqlvehiclei->finish;
$dbh->disconnect;
}
sub adddriver {
$sqldriveri->execute(0,"1","2","a","a","01012001","a","a","01012001",
"M","s","s","u","s","5","20","s","421311890");
}
sub addvehicle {
$sqlvehiclei->execute(0,"111","2002","Yan","Zhu","test","test","A01","A02","farm","f","a","100","a","b","s","x","x","x","d","f","d");
}
sub preparepdqsql {
$sqlvehiclei = $dbh->prepare( "INSERT INTO vehicle
VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)");
if ( !defined $sqlvehiclei ) {die "Cannot prepare sqlvehiclei statement:
$DBI::errstr\n";}
$sqldriveri = $dbh->prepare( "INSERT INTO driver
VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)");
if ( !defined $sqldriveri ) {die "Cannot prepare sqldriveri statement:
$DBI::errstr\n";}
}