Re: do pear packages create their own seperate DB connections?
| From: | Wolfram Kriesing | Date: | Tue, 22 Apr 2003 15:32:41 +0000 |
| Subject: | Re: do pear packages create their own seperate DB connections? | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-15337@lists.php.net to get a copy of this message | ||
Lukas Smith wrote:
yeah i think 1) could be overhead either i) you accept it (or there is a solution to prevent it) or ii) may be [M]DB could/should have a mode which returns always the same instance for one DSN, which of course could cause problems when you depend on [M]DB internal states i am not really sure either -- Wolfram ... opensource @ vision:produktion ... http://opensource.visionp.de ... translating template engine .... http://sf.net/projects/simpletpl ... authentication system .... http://sf.net/projects/authFrom: Wolfram Kriesing [mailto:wolfram@visionp.de] Sent: Tuesday, April 22, 2003 5:12 PMnow i dont have to instanciate the DB myself, since i dont really need it. Only the packages i use need the DB-connection. I actually use only 3 packages that need a DB-connection (iirc) Auth, Tree, DB_QueryTool. To those packages i simply pass the DB_DSN and they (should) handle themselves if/when they need a DB-connection.Hmm well to me there are two things that might create overhead here: 1) object creation 2) connection establishing 2) does not exist in MDB as the connection is created on demand with the first query. So if you simply always create an MDB object which you then pass to any package you use, the only overhead you have in the case you don't need a Db connection is the MDB object creation. I don't really understand how standard PEAR packages should be able to figure out if you have an instance of a certain package from global space without a total mess? I am probably misunderstanding what you are proposing here.