I'm writing a UNIX daemon which is used by clients to retrieve some data from an Oracle database.The daemon uses the module
Net::Server, and of course uses DBI to connect to Oracle.
My question is about the connection to Oracle. I want to connect to Oracle only once (of course), so in the initialization phase I create a database handler.
When a client makes a request to the daemon, a new child is forked (OK I can use Net::Server::PreFork to have a pre-forked pool of children). The child actually executes the query and save somewhere in the file system the results for the client.
This architecture implies that the database handler is shared among all forked children. Is this a problem?
I've noticed that if a child dies (for example because it encounters some problem while saving data for the client) the daemon loses the connection to Oracle. I've read DBI man page and found that there is an attribute for DBI handlers called InactiveDestroy which "It is specifically designed for use in UNIX applications which 'fork' child processes.". Does anyone have any experience with problems of this kind?
Thank you very much.
marcos
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.