perl-embperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gerald Richter" <rich...@ecos.de>
Subject RE: sharing database handles with mod_perl enablement?
Date Tue, 13 Jun 2000 08:09:06 GMT


  Is there anyway to ensure a database handle is not being used by more than
one process on the machine at one time without developing one's own locking
mechanisms?

  We want to limit the number of connections to our database. If the same
.epl page is being hit 50 times simultaneously, we risk an attempt of 50
simultaneous database connections... which is too many.

  I am using DBIx::Recordset and can check $DBIx::Recordset::numOpen for the
number of open database connections, but, under mod_perl with Embperl
$numOpen will not vary if the same open handle is being used by more than
one process... or am I mistaken?

Every Apache child will have his own DBI database handle. You can't avoid
this unless you develop your own locking mechinsmus and explicitly
disconnect from the database if too many handles are open.

The other possibility is to use DBI-Proxy to make your database connection.
In this case DBI Proxy will hold the database handles for you and you can
tell DBI Proxy how many current database connections are allowed.

Gerald








Mime
View raw message