I have been using perl with Oracle (via DBI) for many years, and your initial problem statement (timeout) sounds wrong. Please post more information about what error messages you get from example perl code. I have never had timeout issues where perl was the problem, and thus the solution. I have had many "timeout" failures where the root cause of the problem was webserver (apache) or Oracle database related.

For perl CGI script called via the webserver, I have had the webserver timeout because the CGI script was not completing within a short enough time period. I detected this by looking at the webserver error log. I had to configure apache to wait longer.

For long-running Oracle SQL operations, I have had "timout-like" issues where the Oracle session had resource limits setup such that my session would be terminated. In these instances, the Oracle DBI statement would return an error message to perl which I would print. Then, I would work on adjusting my Oracle resources to allow my long queries to work (or, I would break my queries into shorter bits, perhaps using intermediate tables or PL/SQL routines).

Whenever a perl script runs DBI to connect to an Oracle instance, a "session" is created on the Oracle server. In all my years of working with Oracle, I have only been able to have a single Oracle session run a single SQL statement at one time...never multiple SQL statements simultaneously. (Oracle can do "parallel" query execution, but that is still a single SQL statement, just broken into bits and executed in parallel). I think that if you tried to use perl threading or forking, you would be forced to create two separate DBI database handles, which would result in two separate Oracle sessions. The sessions would be completely independent, so that you may be executing "keep_alive" SQL on one session, while the other session keeps running until it terminates.

There may be some part of perl+DBI+Oracle which I don't know about, but based on what I DO know, the keep_connection_alive() approach you are suggesting is incorrect.

Feel free to e-mail me more details on the SQL issues you are running into and we can try to work on that bit. Also please specify more details about the environment you are running and look for any error logs and messages which would shed more light on the exact nature of your problem.


In reply to Re: multiprocessing in perl by fzellinger
in thread multiprocessing in perl by shijumic

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.