Think about Loose Coupling | |
PerlMonks |
Grouping / Abstracting Database Transactionsby nmerriweather (Friar) |
on Jan 05, 2006 at 00:17 UTC ( [id://521067]=perlquestion: print w/replies, xml ) | Need Help?? |
nmerriweather has asked for the wisdom of the Perl Monks concerning the following question:
I have a webapp. It is made all object oriented. I'm trying to reuse components / objects as much as possible, and am running into a bit of a snag. I've created an abstraction layer to Apache::DBI. it works like this: WebPages check out the write handle as a 'SuperTransaction' Objects check out the write handle as a 'Transaction' or 'NonTransaction' If an object checks out the write handle and a 'super transaction' has begun, then we have a silent acceptance. If there is an error in the 'super transaction', we fail the attempt. The whole idea is to let the web pages group together object actions and rollback/commit if one breaks -- while letting the object actions themselves be encapsulated within transactions if necessary. Herein lies the problem: my abstraction layer is a hack, because I couldn't find anything similar in CPAN. Now I've run into the situation where i need to nest an object transaction within an object transaction within a WebPage transaction ( I support WebObject fine. WebObjectObject is beyond what i can think of getting to work right now) Can anyone make a suggestion on where to proceed?
Back to
Seekers of Perl Wisdom
|
|