You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Cliff Rayman <cl...@genwax.com> on 2000/02/22 05:56:22 UTC

Re: Apache::Session and Apache::DBI do not share dbi handles

Are they all using the same name and password to log into the database?
I have not looked at it in a while, but I wanted to duplicate Apache::DBI's
behavior
for a project of my own.  If I remember correctly, foreach child process and
foreach name,passord pair there is one cached database handle.

cliff rayman
genwax.com

Adam Cassar wrote:

> I am using Apache::Session::DBI in a simple cgi script with mod_perl, and in
> that same cgi I make several connections to the same database that the session
> info is stored.
>
> The several connections that I make in the cgi script using DBI->connect are
> using the shared DBI handle, however Apache::Session::DBI is making a new
> connection and its own 'shared' database handle
>
> how do i know this?
>
> i am using postgres on one machine and count the number of processes that it
> starts. so lets say that running ab on the test script _without_ the sessions
> it might start say 90 copies of postgres this stays relatively constant no
> matter how many dbi->connects i do in the script
>
> however if i enable Apache::Session::DBI the amount of copies of postgres
> jumps to about 120 (it jumps up roughtly by the number of simulaneous
> connections)
>
> does anyone have any reason's to this behaviour? or any way to force
> apache::session to use the the apache::dbi handle
>
> --
>
> Adam Cassar
> Senior Web Developer
> ___________________________________________
> NetRegistry http://www.netregistry.com.au
> Tel: +61 2 9699 6099 | Fax: +61 2 9699 6088
> PO Box 270 Broadway NSW 2007 Australia