Welcome to the world of wan programming. It *can* be done, but you have to do it carefully. I think the problem you are running into, is that the ODBC driver might not have a 'timeout' setting enabled. I know that when I wrote a comm layer using a database and a jdbc driver, executing a 'select' would not timeout, even if the tcp connection was broken. I had to manually specify (in jdbc's dsn string) two timeout values, one for the connect, and one for the time that it took for the connection to return results. Additionally, even when the client timed out right and disconnected the connection, the *server* still thought it had a connection. This was a problem because we quickly reached a 'connection limit' for the server. So, I set the timeout for the jdbc connection && the database connection to the same value, and that (seemed) to work ok....

If you want to test this in the future, consider setting up an openbsd / freebsd box with ipfw on it. You can throttle the network connection, introduce random packet drops, etc. You can then automate your testing by using Net::Telnet or Net::SSH to send commands to ipfw, and Cluster::Run (not yet released, working on it at home) or your favourite Distributed:: module to stress test the server.

Good luck! Must get java filth off my hands... unclean! unclean!


----
Zak

In reply to Re: Timeout problems with DBI by zakzebrowski
in thread Timeout problems with DBI by guha

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.