If you want to use threads in conjunction with DBI, it behoves you to read the pod for the appropriate DBD::*. In this particular case, this might be useful information:

ora_dbh_share

Needs at least Perl 5.8.0 compiled with ithreads. Allows to share database connections between threads. The first connect will make the connection, all following calls to connect with the same ora_dbh_share attribute will use the same database connection. The value must be a reference to a already shared scalar which is initialized to an empty string.

our $orashr : shared = '' ; $dbh = DBI->connect ($dsn, $user, $passwd, {ora_dbh_share => \$orash +r}) ;

That said, your snippet is concealing why you are using threads.

  1. It calls start() 11 times synchronously.
  2. start() creates 25 threads and then waits for the to complete.
  3. Each thread,
    1. creates a (*new*) connection to the DB;
    2. Opens a file;
    3. Closes the file;
    4. Drops the connection to the DB.

It is hard to see why you would be failing for a lack of file handles, when you should have at most 25 open at any given time. Unless Perl on Solaris, or Solaris itself is terminally broken?

The question of whether you could actually benefit from multiple connections to Oracle is entirely obscured.


In reply to Re: Too many open files error with DBD Oracle by BrowserUk
in thread Too many open files error with DBD Oracle by JoeW

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.