RE: CDBI and mod_perl

[prev] [thread] [next] [Date index for 2005/02/23]

From: Perrin Harkins
Subject: RE: CDBI and mod_perl
Date: 18:50 on 23 Feb 2005
On Wed, 2005-02-23 at 17:34 +0000, Addison, Mark wrote:
> I still can't see why you would want to share the dbh
> between the 2. It sounds down right dangerous to me!
> What is wrong with letting the 2 sets of code manage their own
> handles?

Very simple: it will kill the scalability of my application to have
twice as many connections to the database open per apache child process.

> This seems a much cleaner solution, otherwise they may
> get in each others way e.g. one app may change some of the dbh
> attribs in a way the other doesn't like. Would get messy if one
> turned off RaiseError when the other was expecting it. Just as
> bad, what if one bit of code sends sql to the server that changes
> the sessions settings for the connection, e.g. changing the
> collation order, date parsing? The other code has no knowledge
> of this. They may even get in each others way if they happen to
> use a temp table of the same name. etc, etc.

This is true of any situation where any two subs are using the same
database handle.  There's nothing special here just because one of them
is Class::DBI.  Well-behaved code does not do the kind of things you're
describing here.

- Perrin

RE: CDBI and mod_perl
Addison, Mark 17:34 on 23 Feb 2005

RE: CDBI and mod_perl
Perrin Harkins 18:50 on 23 Feb 2005

Re: CDBI and mod_perl
Matt S Trout 02:54 on 02 Mar 2005

Re: CDBI and mod_perl
Perrin Harkins 05:20 on 02 Mar 2005

Re: CDBI and mod_perl
Johan Lindstrom 09:03 on 02 Mar 2005

Generated at 20:58 on 02 Mar 2005 by mariachi v0.52