[Catalyst] Testcase for DBIx::Class::Loader - demonstrates failure under load

Perrin Harkins perrin at elem.com
Mon Feb 13 20:12:40 CET 2006


On Mon, 2006-02-13 at 10:30 -0600, Brandon Black wrote:
> > I wonder how that effects rollbacks at the end of processing (with and without
> > Apache::DBI).
> > I'll have to test that out sometime.
> >
> 
> It should have no ill effects for the "normal" DBIC case (like
> C::M::DBIC::Plain / C::M::DBIC::Schema), the only ill effects will be
> under DBIC ::Loader and ::Schema::Loader.  DBIC itself does
> rollback-on-disconnect itself before calling the DBI disconnect
> method, and it does this anytime the storage is being DESTROYed
> (Apache::DBI kinda nullifies the actual disconnect, but the process is
> dying anyways, so no biggie).

I may be reading this incorrectly, but it sounds like you're talking
about rollbacks at disconnect time.  Apache::DBI does a rollback at the
end of every request if you have AutoCommit off, in case your code dies
with some uncommitted changes in progress.  If you don't use
Apache::DBI, or you keep AutoCommit on most of the time, you should add
your own cleanup handler to do a rollback like this.  Otherwise, you can
end up committing bad data on the next request.

Also, Apache::DBI is intended to prevent caching of handles during
server startup, but that is probably foiled by DBIx::Class, just like it
is by Class::DBI.

- Perrin




More information about the Catalyst mailing list