>From the 1.16 changelog for DBI
"Fixed build for perl5.6.1 with PERLIO thanks to H.Merijn Brand."
Not sure if it's related.
Looks like you have two choices - update your DBI module to 1.18 or add a
$SIG{CHLD} handler.
Dan
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Thursday, July 19, 2001 11:21 AM
To: [EMAIL PROTECTED]
Subject: DBI / DBD::Oracle: defunct process after $db->disconnect
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]