shijumic has asked for the wisdom of the Perl Monks concerning the following question:

I am getting a wierd oracle error from my perl script. I am new to perl, and I don't have any clue what causes this DBD error.
The following is my script
$done=0; unless($pid = fork()) {#child #This is a simple query that constantly runs on table like dual at + regular intervals print $ur->connect() while (!$done) and sleep 5 ; } #calling other methods that loads data to database $obj->method1(); $done=1;

Both parent and child shares the same database handle..
It needs to be so to keep only one oracle session open and make it alive..
But after everything executed, I am getting an oracle error like the following..
ORA-03113: end-of-file on communication channel (DBD ERROR: OCIStmtExecute/Describe)
Any help will be greatly apreciated. Thanks
  • Comment on ORA-03113: end-of-file on communication channel (DBD ERROR: OCIStmtExecute/Describe)
  • Download Code

Replies are listed 'Best First'.
Re: ORA-03113: end-of-file on communication channel (DBD ERROR: OCIStmtExecute/Describe)
by almut (Canon) on Apr 20, 2009 at 21:33 UTC
    Both parent and child shares the same database handle..

    That presumably is your problem. See InactiveDestroy.

      Thanks Guys. It did really help me. So Basically I have set "INACTIVE_DESTROY" => 1 and have reset my db connection for the child processes and now it is perfectly working.
Re: ORA-03113: end-of-file on communication channel (DBD ERROR: OCIStmtExecute/Describe)
by roboticus (Chancellor) on Apr 20, 2009 at 21:33 UTC
    shijumic:

    I doubt that the DBI/DBD system is going to be happy sharing a connection to the database like that. Anyway, what I think you're seeing right now is that when your child process ends, it's closing the connection, making it unavailable to the parent any longer.

    ...roboticus
      The probelm here is child doesn't exit after the parent dies..any idea how to kill the parent and child simultaneouisly..
      ,some example would be greatly appreciated!! thanks