Hello,
we're using Perl-5.6.1 with DBI-1.15 and DBD-Oracle-1.06 on Solaris 7 to
connect to several databases. We've found, that calling $dbh->disconnect is
ending the oracle-client, but the return code of the child is not collected
with a "wait"-call. So we get a defunct-process for each disconnected
database:
A small test-program shows the behaviour:
>>>>>>>>>>>>>>> test.pl <<<<<<<<<<<<<<<
#!/opt/perl/bin/perl
use DBI;
print "connecting to database ... ";
$db = DBI->connect("dbi:Oracle:test",' / ','') or die "failed!\n";
print "ok\n";
print "disconnecting from database ... ";
$db->disconnect or die "failed!\n";
print "ok\n";
print "loop (break with ^c)\n";
while (1) {} ;
>>>>>>>>>>>>>>> test.pl <<<<<<<<<<<<<<<
When the program reaches the loop at the end, the oracle-child is ended, but still in
the state "defunct":
# /usr/proc/bin/ptree 22289
22289 /opt/perl/bin/perl ./test.pl
22290 <defunct>
By using truss, I've confirmed, that the defunct process is the oracle-client
(/opt/app/oracle/product/8.0.6/bin/oracle).
We're using scripts, which connect and disconnect sequentially to about 40
databases. So we've a bundle of defunct processes during execution of this
script. It would be nice to get rid off these defunct processes. In my
opinion, the $db->disconnect should get the return code of the oracle
client, so that the process is terminated completely.
I did not find any information on this in the DBI/DBD-documentation. I've
also looked into the source code (without success). So my question is,
whether this behaviour is considered as a bug or a feature?
Regards
Thomas Stümpfig
Sparkassen Informatik Baden-Württemberg
Abt. 3110 Betriebssysteme
Wilhelm-Pfitzer-Straße 1
D 70736 Fellbach
Germany
Mailadr.: [EMAIL PROTECTED]