perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Octavian Rasnita" <>
Subject Re: How do you use mod_perl for your web application?
Date Mon, 27 Jun 2011 19:53:37 GMT
Here is a comment that might be helpful, because it also explains why DBIx::Class can work
with Apache::DBI (and why it is not needed):

DBIx::Class already manages its connections for you, and therefore it
cannot benefit from Apache::DBI under any scenario.  It makes one
connection per-process, and keeps that connection persistent,
reconnecting only if the connection appears to have died, or if you
fork/thread over to another process/thread-id.  The only Apache::DBI
issue in DBIx::Class is that Apache::DBI will actually thwart
DBIx::Class's connection management code, and cause it to use the same
(and invalid) connection in a new process, in cases such as (as
mentioned above) if you make a DBI connection before forking in a
prefork mod_perl server.
To work around this, DBIx::Class has specific code in it to work
around Apache::DBI, nullifying the effects of Apache::DBI on
DBIx::Class.  Essentially, loading Apache::DBI should change nothing
and be rather pointless under DBIx::Class.

The only reason we support it (support working around it) is because
someone might want Apache::DBI loaded up under the same mod_perl as a
DBIx::Class application to support a different legacy application
which does not use DBIx::Class, in which case they share a perl
interpreter and will both have the same set of modules loaded.


----- Original Message ----- 
From: "Fred Moyer" <>
To: "Octavian Rasnita" <>
Cc: <>; "mod_perl list" <>
Sent: Monday, June 27, 2011 6:37 PM
Subject: Re: How do you use mod_perl for your web application?

> On Sun, Jun 26, 2011 at 10:55 PM, Octavian Rasnita <> wrote:
>> From: "Randolf Richardson" <>
>>> I believe Catalyst depends on DBIx::Class, which also tries to turn
>>> off the connection caching features provided by Apache::DBI (if I'm
>>> recalling correctly) -- if this is true, then it could certainly help
>>> to explain the lesser performance in a ModPerl environment.
>> Catalyst doesn't depend on DBIx::Class.
>> DBIx::Class just does its own persistent connection and this is why it
>> doesn't need Apache::DBI.
> Do you have any evidence for this claim?  I've been using DBIx::Class
> with Apache::DBI for several years and have never seen anything to
> this effect.

View raw message