in reply to Re: question on OO design and object composition
in thread question on OO design and object composition

i am aware of connect_cached. however, we use different user/pwd for every webapps so the $dbh i pass to company::api is that special dbh for a certain webapp. there is no way to get the dbh except passing it from the webapp.

it would be much simpler if we are using a sigle dbh handler for every apps so i could do company::db->dbh to get the same dbh all the time. but that is not the case for me..

  • Comment on Re^2: question on OO design and object composition

Replies are listed 'Best First'.
Re^3: question on OO design and object composition
by samtregar (Abbot) on Mar 22, 2008 at 06:59 UTC
    Huh? So you want to share around a DBI handle, but you can't use connect_cached because each object has its own user/pass. If that's the case, how can you share a DBI handle in the first place?

    -sam

      i am using connect_cached().

      my problem is that i have to pass a dbh(supposedly one for each webapp under mod_perl) to the company::api by way of calling $c = company::api->new($dbh). then in company::api, i have to pass this $dbh to other company:: modules

      sorry if i wasn't clear on this.