Re: system() return code always '-1' after DBI/DBD local connection
- From: Tim.Bunce@xxxxxxxxx (Tim Bunce)
- Date: Fri, 20 May 2005 23:19:12 +0100
Welcome to Oracle. I believe Oracle sets a SIGCHLD signal handler.
http://www.cs.nott.ac.uk/TSG/manuals/databases/oracle/standard/a90347/ch4_comp.htm#26201
I've never found a *good* solution (but then I've not actually tried hard).
Ugly but practical solutions probably include trying to force perl to
restore its own sigchld handler. Something like this:
$dbh = DBI->connect(...);
$SIG{CHLD} = 'DEFAULT';
system(...);
Hopefully someone on the list has actually had to find a way that works
and can help out.
Tim.
On Fri, May 20, 2005 at 03:17:09PM +0100, David Bartlett wrote:
> Dear all,
>
> I am attempting to package a common Perl v5.8.6 + DBI
> v1.48 + DBD::Oracle v1.16 on Solaris 8+ for use at my
> site. The DBD::Oracle module has been compiled against
> Oracle 10g client and appears to be able to connect OK
> to Oracle 8i, 9i & 10g databases. However, one of my
> beta-tester developers has raised the following
> concern with regards to return codes from the 'system'
> command following a [successful] local database
> connection. After making a connection with DBI, it
> appears that all future 'system' commands return exit
> code '-1', example:
>
> $rc = system("echo 'hello world'); # return code
> "0", as expected.
> $conn_str = "dbi:Oracle:";
> $username = "/";
> $passwd = "";
> if( !($APP_Handle =
> DBI->connect($conn_str, $username, $passwd)))
> {
> $internal_error =
> $internal_error."Could not connect to
> $ENV{ORACLE_SID}: ".$DBI::errstr.".";
> return;
> }
> $rc = system("echo 'hello world'); # return code
> "-1" received, not expected.
> $rc = system("echo 'this will not work either'); #
> return code "-1" received, not expected.
>
> The key points are:
>
> i. The database name is omitted after the dbi:Oracle:.
> This forces a local connection (ie. Not via SQL*Net)
> using the $ORACLE_SID environment variable.
> ii. The username is set to "/" and the password is
> blank. This forces an externally defined connection
> using the UNIX user for authentication.
>
> Due to in-house security policies, our developers must
> connect to their Oracle databases using the above
> method.
>
> - Has anyone else experienced this issue/potential bug
> previosuly?
> - Can anyone else verify that they get this unexpected
> behaviour also? What Perl/DBI/DBD/Oracle client
> versions do you use?
>
> Thanks a lot for any help you can offer,
>
>
> David Bartlett.
>
>
>
>
>
>
> ___________________________________________________________
> Yahoo! Messenger - want a free and easy way to contact your friends online? http://uk.messenger.yahoo.com
.
- References:
- system() return code always '-1' after DBI/DBD local connection
- From: David Bartlett
- system() return code always '-1' after DBI/DBD local connection
- Prev by Date: Re: DBI->disconnect is not a DBI method. Read the DBI manual. at ff.pl line 224
- Next by Date: Re: Perl Performance Help.
- Previous by thread: system() return code always '-1' after DBI/DBD local connection
- Next by thread: postgres SSL
- Index(es):
Relevant Pages
|