Beefy Boxes and Bandwidth Generously Provided by pair Networks Joe
Perl: the Markov chain saw
 
PerlMonks

connection lost while passing oracle db handler to forked process

by kulls (Hermit)
 | Log in | Create a new user | The Monastery Gates | Super Search | 
 | Seekers of Perl Wisdom | Meditations | PerlMonks Discussion | 
 | Obfuscation | Reviews | Cool Uses For Perl | Perl News | Q&A | Tutorials | 
 | Poetry | Recent Threads | Newest Nodes | Donate | What's New | 

on Nov 04, 2009 at 14:46 UTC ( #804938=perlquestion: print w/ replies, xml ) Need Help??
kulls has asked for the wisdom of the Perl Monks concerning the following question:

Hi,
I want to use the same db handle in the muliple child processes and i have also set
 $dbh->{InactiveDestroy} = 1 but while processing following error message is coming:

DBD::Oracle::st execute failed: ORA-03135: connection lost contact (DB +D ERROR: OCIStmtExecute)

Can you suggest me any reason or changes need to be made?
-Raja

Comment on connection lost while passing oracle db handler to forked process
Select or Download Code
Re: connection lost while passing oracle db handler to forked process
by zwon (Curate) on Nov 04, 2009 at 14:59 UTC

    You can't use one db handle in multiple processes. That would at least require some synchronization between processes, so no two processes use connection to db simultaneously. And if one process closes connection, it will be closed in other processes too, that's probably why you getting this error.

[reply]
Re: connection lost while passing oracle db handler to forked process
by moritz (Chancellor) on Nov 04, 2009 at 15:29 UTC
[reply]
Re: connection lost while passing oracle db handler to forked process
by ikegami (Saint) on Nov 04, 2009 at 15:53 UTC

    I want to use the same db handle in the muliple child processes

    Why would you want to do such a thing? You'd have to add lots of code to make sure that only one thread uses the connection at any given time. If these are database heavy threads, they'll be constantly blocked, waiting to use the connection.

[reply]
Re: connection lost while passing oracle db handler to forked process
by pajout (Chaplain) on Nov 04, 2009 at 17:39 UTC
    Perhaps http://sqlrelay.sourceforge.net/ is what do you need.
[reply]
Re: connection lost while passing oracle db handler to forked process
by angelos (Initiate) on Nov 06, 2009 at 10:55 UTC
    Never do that, you are in danger of one forked process mangling prepared SQL statements in a sibling.
[reply]

Back to Seekers of Perl Wisdom


Login:
Password
remember me
What's my password?
Create A New User

Node Status
node history
Node Type: perlquestion [id://804938]
Approved by zwon
Front-paged by Arunbear
help
Community Ads
Chatterbox
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users
Others chanting in the Monastery: (7)
tirwhan
Moriarty
atcroft
herveus
Eyck
biohisham
gnosti
As of 2009-11-21 11:02 GMT
Sections
The Monastery Gates
Seekers of Perl Wisdom
Meditations
PerlMonks Discussion
Categorized Q&A
Tutorials
Obfuscated Code
Perl Poetry
Cool Uses for Perl
Perl News
Information
PerlMonks FAQ
Guide to the Monastery
What's New at PerlMonks
Voting/Experience System
Tutorials
Reviews
Library
Perl FAQs
Other Info Sources
Find Nodes
Nodes You Wrote
Super Search
List Nodes By Users
Newest Nodes
Recently Active Threads
Selected Best Nodes
Best Nodes
Worst Nodes
Saints in our Book
Leftovers
The St. Larry Wall Shrine
Offering Plate
Awards
Craft
Snippets Section
Code Catacombs
Quests
Editor Requests
Buy PerlMonks Gear
PerlMonks Merchandise
Planet Perl
Perlsphere
Use Perl
Perl.com
Perl 5 Wiki
Perl Jobs
Perl Mongers
Perl Directory
Perl documentation
CPAN
Random Node
Voting Booth

Future historians will find that the material characteristic of the current era is...

Aluminium
Plastic
Oil
Water
Carbon dioxide
Copper
Iron
Silicon
Salt
Uranium
Hydrogen
Other

Results (730 votes), past polls