Perrin Harkins wrote: > On 3/16/07, Christopher H. Laco <[EMAIL PROTECTED]> wrote: >> My point is, there's no sane way to do a big jumble of code in one DB >> transaction without having to go code diving for a dbh to work against, >> ala 'local $dbh->{AutoCommit} and such. > > So you're saying that one of your tools is trying to do automatic > commits for you. Which one? > >> If I'm working in a Catalyst app, and I need $c->model('DBModuleOne') >> and $c->model('DBModuleTwo') to do some work, and both either commit or >> rollback, I have to do module diving to get at each models dbh and write >> mode transaction management code. > > Those database objects shouldn't be handling transactions. They are > too low-level for that. Methods above them that you write should do > all of the transaction handling. >
I agree. But even that becomes messy. So, I have my Cat models all provide commit() and rollback(). Great. Now I have to write Catalyst controller code to cycle through those models based on success/failure and call commit/rollback. Fine. Sounds sane. Now, I want to use my models outside of Catalyst, let's say in a perl script. Now I have to write yet another block of code to do monitor success/failure, and call commit()/rollback(). Now, I can wrap my models in yet another wrapper to do what the cat controller and the perl script just did....but now that model is unaware about the script that uses IT. Now I have to write more code, to call the code to call commit/transaction. And so on an so forth. I don't disagree with you at all. It just seems like with all of the ORMS out there and all of the ways to use 'schema classes' from them, doing transactions in levels (or multiple levels above) is clumsy at best. -=Chris
signature.asc
Description: OpenPGP digital signature
------------------------------------------------------------------------- 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