Re[3]: [PHP-DEV] Major Bug in multiple MySQL Connections?
| From: | Rasmus Lerdorf | Date: | Mon, 22 Apr 2002 17:01:08 +0000 |
| Subject: | Re[3]: [PHP-DEV] Major Bug in multiple MySQL Connections? | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-83154@lists.php.net to get a copy of this message | ||
Because the current db is not a property specified in mysql_connect() so I
don't see what you would be switching back and forth from/to.
-Rasmus
On Mon, 22 Apr 2002, Daniel Lorch wrote:
> hi,
>
> this sounds reasonable. But why don't the "connection aliases" keep
> the current db they are working on and if needed, switch back -
> transparently to the user? The current implementation only confuses
> people.
>
> -daniel
>
> ----- Original Message -----
> >From : Rasmus Lerdorf [mailto:rasmus@lerdorf.ca]
> Sent : Montag, 22. April 2002
> Subject: [PHP-DEV] Major Bug in multiple MySQL Connections?
>
> > It's not a silly behaviour. Database connections are a very limited
> > resource, much more so than open files, and time after time we saw code
> > that would open up multiple identical connections for no reason
> > whatsoever. This is especially true of large apps that are able to swallow
> > other apps. Like PHP-Nuke with various plug-in modules. If you patch 3 or
> > 4 different things together that all talk to a DB on localhost, you do not
> > need to go through the code and unify the database handling to avoid
> > having 4 separate connections per request. PHP automatically optimizes
> > that for you. Opening a new connection is also extremely expensive, much
> > more so than a simple db switch call on an existing one.
>
> > -Rasmus
>
>