Hi all,
During my praying to the Wall, i encountered the following...

We used a DBH class, that returned a DBI connection to a MySQL database. It used the @EXPORT_OK = qw(&DBOBJ); so the object could be accessed using the singleton pattern... BUT...
The MySQL server runned away sometimes, leaving us with a big error screen instead of results...
Then we tried to use APACHE::DBI's ping, to see if the connection was still there, and it was???? This would be magic, but we found out, that this was the penalty of trying to make an object that had a persistent database connection, and even believed this when the MySQL server runned away...
This is checkable by just restarting the MySQL server to emulate the effect.

For now, we're not using Apache::DBI anymore, but built our own (using DBI's source as a guide) so our ping is working again, even with a persistent connection. (when the ping fails, we rebuild the connection
However, i refuse to believe that this would be the only (and best) solution, and think that Apache::DBI could do more for us, i'd use to think that Apache::DBI would handle all connections for us.
Any thoughts on how to enlighten our path again would be welcome.

In reply to Singletons, Apache::DBI and MySQL by jbrugger

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.