>>>>> "Jud" == Jud  <[EMAIL PROTECTED]> writes:

Jud> I'm not sure how to get Rose to use only a single database object for all
Jud> classes and objects. I am looking for a better way than to create a new
Jud> Rose::DB object at the beginning of every script, and then pass it to
Jud> each object as it gets created using MY::Object->new(db => $MY_DB, ... )
Jud> for every one.  Specifically, I'm using a transaction during a unit
Jud> testing, and I want be sure that all objects that are created/modified
Jud> are part of the same db handle so I can roll back at the end of the
Jud> test. It seems I would need to specify the DB both in my application, and
Jud> in my test, which seems like a lot of overhead.

Keep in mind that the current scheme actually works well when you're creating
a cluster of "related" rows to ensure integrity, because the linked rows will
share the same DB handle.  Using a single DB handle for all objects *reduces*
the flexibilty to say "no, this particular group now belongs out of the
result" on a group-by-group basis.

-- 
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

Reply via email to