in reply to Using CGI:App and Session plugin - double DB connection fix.

If the problem is that you have a number of pages that don't require sessions (or any db access), and a number that do, then simply put the two groups into different CGI scripts, with different setups - one which creates the db handle, the other which doesn't.

If the problem is that db connection is too expensive, check out Apache::DBI with mod_perl, or you could write your own connection concentrator daemon using DBI::Proxy.

  • Comment on Re: Using CGI:App and Session plugin - double DB connection fix.

Replies are listed 'Best First'.
Re^2: Using CGI:App and Session plugin - double DB connection fix.
by techcode (Hermit) on Sep 15, 2005 at 07:41 UTC
    Splitting them could be problematic and lead to other problems as at this point CGI::Application, CGI::Application::Plugin::AutoRunmode and CGI::Application::Dispatch all together basically act as an Controller (as in M-V-C). I've already divided functions into logical entities - packages that contain related runmodes.

    I just wish I could use mod_perl - and Apache::DBI with it. Just plain CGI for now - if performance becomes a problem at some point since they are on dedicated host that host only another of their sites mod_perl could be possible. But it's very unlikely - while they have large customer base that would use it - it's an tool to make recurring orders. So I imagine that it wont be visited often after you make your order.

    Will see about DBI::Proxy. And will have to make shure my DB abstraction module will work under Apache::DBI.