Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.12.1

Request #4094 Connect-On-Demand?
Submitted: 2005-04-07 06:07 UTC
From: paul at botelho dot ca Assigned: danielc
Status: Wont fix Package: DB
PHP Version: Irrelevant OS: Any
Roadmaps: (Not assigned)    
Subscription  


 [2005-04-07 06:07 UTC] paul at botelho dot ca
Description: ------------ Any any thoughts about supporting "connect-on-demand" allow users to create a db object, however do not actually connect to the database until they do the first query. I have a large app, that requires connections to several databases(/servers) - but not all the time. i dont know which connections will be used until the app runs. (generic init function opens all connections) I've tried a simple hack, that allows me to create db objects (with no connection) and then, if there is no connection - establish it on the query() function. seems to work, needs more work & testing

Comments

 [2005-04-07 07:22 UTC] smith at backendmedia dot com
This is actually quite a bit of work to implement and get working properly. I dont know what Dan's opinion is on this (he is the lead maintainer), however I think that the dangers of BC break/instability are too great. Instead you should try out MDB/MDB2 (disclaimer: I am the lead maintainer of MDB/MDB2).
 [2005-04-07 13:12 UTC] danielc
Connect on demand would cause DB to be slower in order to allow users to write sloppy applications. No thanks.
 [2005-04-07 18:47 UTC] paul at botelho dot ca
fair enough, I'll take a look at mdb/mdb2
 [2006-04-06 17:10 UTC] david at futuresbright dot com (David Kelly)
This idea is best implemented by creating your own bean class.