The big catch for you is your second question.

If I don't specifically exit() the script that gets the $dbh will the connect stay open?

You can maintain persistent connections to the database but you'll need a persistent process to manage them for you. I don't know much about Zeus. I think if you are dependent on your service provider for things like which server software will run, then developing this much complexity into your application is probably not a real option for you.

The good news is that you rarely really want to do what you are attempting anyway. The approach will tend to make your performance graphs look like a staircase because you are allocating resources to each user and tying those resources up even while the user is idle. With a good web application a user will only consume resources during an actual request at least as far as CPU and RAM go. (Disk usage is, of course, a different story.) Maintaining persistent DB connections makes the most sense in a case where users can share those connections.

The bad news is that you should probably bring your design back to the drawing board.

-sauoq
"My two cents aren't worth a dime.";

In reply to Re: Another session state question by sauoq
in thread Another session state question by robertv

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.