Subject: | Errors when closing pipe after DBI->connect |
Date: | Mon, 5 May 2008 11:32:13 -0700 |
To: | <bug-DBD-Oracle [...] rt.cpan.org> |
From: | "Anusauskas, Laimonas" <LAnusauskas [...] corp.untd.com> |
Hi,
We are seing strange problem with Perl "close" function on a pipe
returning errors no matter what the exit code of the actual program is.
It only happens after connection is established to the local database,
before connection is established "close" function works as it should.
This only started happening after we upgraded Oracle to version 10.2 and
recompiled DBD-Oracle driver. We didn't have this problem with DBD
compiled with 9.2 libraries. Also, this issue doesn't appear after
connection to MySQL database, so its not the issue with DBI itself.
This only happens if connection is local and doesn't happen if
connection is using network. My feeling that this has something to do
with the fact that Oracle client forks separate server process to
connect to the local database and that somehow messes up Perls waitpid
call.
OS: Solaris Sparc 2.10
Perl: v5.8.8 built for sun4-solaris-64
DBI: DBI-1.604
DBD-Oracle: DBD-Oracle-1.21
I also reproduced the same problem when compiling for 32bit.
Test case:
Show quoted text
------ Cut here ----
#!/u01/dba/config/perl -w
use DBI;
use strict;
warn "Before connect";
open(PIPE,"|/bin/tee") || die("Can not launch command");
warn close(PIPE) ? "No errors" : $!;
my $dbh = DBI->connect(
"DBI:Oracle:",
"system","***",
{TraceLevel => 0,RaiseError => 1,
AutoCommit=>0,PrintError=>1})
or die("Failed to connect:$DBI::errstr");
warn "After connect";
open(PIPE,"|/bin/tee") || die("Can not launch command");
warn close(PIPE) ? "No errors" : $!;
$dbh->disconnect();
exit(0);
----- Output ---
Before connect at ./dbd_bug.pl line 6.
No errors at ./dbd_bug.pl line 8.
After connect at ./dbd_bug.pl line 16.
No child processes at ./dbd_bug.pl line 18.
-----
Best regards,
Limus
Sr. Oracle DBA
United Online, Inc.