This is a question about whether the DB connection pooling in these three modules work together. I have a bunch of scripts for which I put all DB access code into a DB module, it provides, among other things, a sub like:
sub get_connection{ return DBI->connect_cached($dbUrl, $dbUser, $dbPassword, { RaiseError => 0, PrintError=>1,AutoCommit => 1}) or warn("Failed to connect to DB"); }
The other scripts simply call get_connection whenever they need a connection. Since the call is to connect_cached, I'm not closing the connection in other scripts. This seems to be working fine. But, some of the scripts are deployed into mod_perl with Apache::DBI pre-loaded, which provides connection caching. Furthermore, I'm also using Class::DBI in some other scripts, which I understand also uses its own connection caching. All of these work on the surface, but I'm not sure whether caching is actually taking place, and which module is doing the caching, and whether there is any potential conflicts here. Thanks.

In reply to DBI::connect_cached, Apache::DBI and Class::DBI by johnnywang

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.