On 2/8/07 3:00 PM, Jonathan Vanasco wrote:
> sub make__rose_db_obj {
> my  ( $dbh )= @_;
> my  $rdb_obj= FindMeOn::RoseDB->new();
> $rdb_obj->{'dbh'}= $dbh;
> return $rdb_obj;
> }

Is FindMeOn::RoseDB a Rose::DB subclass?  If so, it has a dbh() method that
takes an argument:

http://search.cpan.org/dist/Rose-DB/lib/Rose/DB.pm#dbh

No need to be evil and reach into its hash :)

> 1)   Just to make sure -- are the objects returned by the manager
> inheriting that particular instance of the db (including the dbh
> override) ?  or are they making a new class instance of the dbh ?  i
> know that a set of manager objects share a single db stashed in the
> first item, i'm just wondering if that db object a reference to the
> object the manager was called with, or a new instance of the same
> class.  i think its a reference to the existing object - i just want
> to make sure.

If the share_db parameter to the Manager call is true (the default), then
whatever Rose::DB-derived object the Manager used to do the query is
inserted into every Rose::DB::Object-derived object returned.  If you do not
supply a Rose::DB-derived object to the Manager (using the "db" parameter)
then one will be created by calling the init_db() method of the
object_class.  (The docs call this an object method, but it's called as a
class method in this case.  The docs are updated in SVN.)

> 2) what would be a good way to kill the db connection ?  i was
> thinking of a helper method as simple as this:

"Kill"?  Why not just set share_db => 0 in your Manager call to keep any of
the returned RDBO-derived objects from having a db at all?

> 3) what about making the get method 'dbh' a get/set?

:)

> 4)  this is really trivial, but what about renaming the internal
> stash 'db' to __db -- i don't mean to change the accessor name, but
> just where it stashes the info.  all of the rose db 'operational'
> data and metadata seems to be nicely stashed away to 'private'
> styled names, while column names are plaintext.

You should never know what those keys are anyway! :)  (Also, column values
are stored in a few places, not just under the "expected" unadorned names.)

-John



-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object

Reply via email to