in reply to Tomcat, CGI scripts and DBI connection persistence

DB connections cannot survive a process's lifespan. I really don't know anything about Tomcat, but I don't see anything about a persistent Perl interpreter (i.e. one that survives more than one request).

  • Comment on Re: Tomcat, CGI scripts and DBI connection persistence

Replies are listed 'Best First'.
Re^2: Tomcat, CGI scripts and DBI connection persistence
by spx2 (Deacon) on Oct 30, 2011 at 11:07 UTC
    After reading the docs of Apache::DBI I thought that this is .. in fact , possible. Are you sure they can't span a process's lifespan ?

      Apache::DBI is used in combination with mod_perl. It maintains a pool of DBI connections inside each Apache process, that can be used by Perl code executed by mod_perl, still inside the Apache process.

      Alexander

      --
      Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)

      Perl code executed by mod_perl is executed in a Perl interpreter in the Apache process. The interpreter is created when apache starts up and it persists on until the apache child exits.

      While the db connection is still limited to a process -- each apache process has its own pool -- that process can handle more than one HTTP request.