Re: system() return code always '-1' after DBI/DBD local connection



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
.



Relevant Pages

  • Re: Connecting to an Oracle Database
    ... You can also use FrontPage, ... Click Add to Catalog under "Database Connections" ... Put in your Oracle connection string in the custom connections dialog ...
    (microsoft.public.sharepoint.windowsservices)
  • RE: Query Oracle, show results (need help!!)
    ... After the DB connection, put this... ... I am trying to log into an Oracle database, ... Prepare the SQL statement for running and it'll be stored in Oracle buffer ...
    (perl.beginners)
  • ADO connection to Oracle
    ... the runtime version, however, the program terminates with no error ... The program always stops at the connection to the database. ... connection is made using generic OLE DB, not the Oracle data provider. ...
    (microsoft.public.vb.database.ado)
  • Re: How to use tnsping programmatically
    ... database is there. ... the need is to avoid attempting the connection if the Oracle instance ... Simply because you can tnsping the listener doesn't mean the database ... of connectivity/bandwidth on this connection. ...
    (comp.databases.oracle.misc)
  • RE: ADO.Net Connection Pooling Problem with Oracle
    ... the CLR is releasing the connection to your database. ... the number of database sessions in Oracle seem to ...
    (microsoft.public.dotnet.framework.adonet)