>>>>> "Perrin" == Perrin Harkins <[EMAIL PROTECTED]> writes:
Perrin> I assume you're talking about the faked multiple levels of commit that Perrin> DBIx::Class provides. The simplest answer is to just stay away from Perrin> all that stuff. Do the commits yourself, at the highest level. Keep Perrin> it out of your O/R mapper objects. Since this *is* the RDBO mailing list, what I recently learned about RDBO transactions might be useful. Commits are relative to a DBH, which is normally a member of a DB. By default, when you use a manager method to get a collection of rows, or a ->new method on a row class, you get a distinct DB and therefore DBH. And, by default with that, on sane DBs like Postgresql, things like ->save become cascaded saves that are done within a transaction that RDBO sets up itself. However, if you call ->begin_work on a given DB, then RDBO is smart enough to know that you're in charge, and ->save does nothing but write the rows within the transaction that you started, without its own commit. You will need to explictly ->commit or ->rollback on that DB when you're done. This permits the level of control that you are suggesting. Note that to have this work, you must be looking at the very same DB that is being used by your objects. It's not enough to simply share the DBH (as when you are using Apache::DBI). In my application, I've overridden init_db so that the *same* DB is returned for my entire application, regardless of the individual row class or manager. Thus, I can call ->begin_work on this cached DB at the beginning of the web hit, then ->abort in my error hook or ->commit in my completed hook, and know that for this web hit, the world is either a new sane place, or the same place it was before the hit. It worked out to be a reasonable model, and trivial to implement. RDBO is flexible... you just have to know and understand how to use it. -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 <merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/> Perl/Unix/security consulting, Technical writing, Comedy, etc. etc. See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training! ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ Rose-db-object mailing list Rose-db-object@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rose-db-object