PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » Database » DB » Bug #4094

Connect-On-Demand?

Details

Request #4094Connect-On-Demand?
Submitted2005-04-07 06:07 UTC
Frompaul at botelho dot ca
Assigneddanielc
StatusWont fix
PackageDB
PHP VersionIrrelevant
OSAny
Roadmaps(Not assigned)

Comments

[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

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

This idea is best implemented by creating your own bean class.