perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dave Morgan <dave.mor...@borealescapes.ca>
Subject Re: Apache::DBI and DBIx::Class [was Re: How do you use mod_perl for your web application?]
Date Mon, 27 Jun 2011 23:20:57 GMT
On 27/06/11 04:27 PM, David E. Wheeler wrote:
> On Jun 27, 2011, at 1:40 PM, Dave Morgan wrote:
>
>>> You lost me. But really, I strongly recommend against the use of Apache::DBI.
Some discussion here:
>>>
>>>    http://search.cpan.org/dist/DBIx-Connector/lib/DBIx/Connector.pm#Description
>>>
>>
>> And having read that, I strongly recommend against the use of DBIx-Connector.
>> But then I'm just a production DBA :)
>
> Me too. What weaknesses do you see in it?

What's the point of it?

As far as I can see the author claims to have issues with Apache::DBI and does not
like the hidden aspect. I have never experienced his "issues" and the hidden
aspect is the good part. Apache::DBI can be deployed by an admin without
consulting the developers, without affecting their code. It does not require
any "use" statements in the source code.

He claims that it does no caching across threads. Why not? If the thread uses
the same connection/session state then why not use a cached connection. If
it doesn't then it is the developers responsibility.

Transaction management: I cannot see the point of it, however, I can see the
utility to others. My personal viewpoint is that a
	if good commit, else rollback
make what's happening explicit which when dealing with a db is extremely useful.

Mind you I believe AutoCommit is a bad thing and should never have been made.
My shop also use stored procs for almost everything. Wish DBD::Pg would let
me read cursors, like DBD::Oracle, that's what I really need.

I suppose it is all a matter of personal preference but I have found that the
further removed the developer is from the database the worse they are at accessing
it. DBIx::Class is the perfect example. Please spare me the hassle of trying
to debug/explain/improve any code that uses that. I am sure that high quality
code can be written using DBIx::Class but I have yet to see it.

Oops, just realized you are the author :). Please don't take anything above
personally, I just think that if you wanted transaction management, it would
have been better to write a module that just does that and nothing else.
Then, if a developer in my shop wanted to use it I could load it without
having to worry about apache managing two connection pools.

IMHO, worth exactly what you paid for it

Dave
>
> Best,
>
> David
>
>


-- 
Dave Morgan
Operations Manager, BorealEscapes
http://www.borealescapes.ca
dave.morgan@borealescapes.ca
403 288 8759

Mime
View raw message