On Thu, 2006-05-18 at 16:20 -0700, Bill Moseley wrote:
> > That's one problem.  Another one is that Apache::DBI's safety rollback
> > is prevented from happening because Class::DBI not calling connect() on
> > every request.  You may or may not need that, depending on how you use
> > transactions.
> 
> Oh, right.  I'm not using Apache::DBI.  Nor am I using set_up_table().
> So looks like I'm safe.

It's not that anything bad happens when you use Apache::DBI, but rather
that the automatic rollbacks that Apache::DBI normally does for you will
not work when you use Class::DBI.  If you are absolutely certain that
there's no way your app could die and leave a database handle with some
uncommitted data, then don't worry about it.

My solution is to do what you see on the wiki page:

   $r->push_handlers(PerlCleanupHandler => sub {
       MyClassDBI->dbi_rollback();
   });

- Perrin

Reply via email to