From:             [EMAIL PROTECTED]
Operating system: not os related
PHP version:      4.0.4pl1
PHP Bug Type:     Feature/Change Request
Bug description:  mysql_connect() forces reuse of the connection

Hi all,

i've just discovered that mysql_connect() uses a hash that forces it to
reuse a connection on a second call to mysql_connect() with the same
arguments, instead of opening a new connection.
This was, at least for me, an unexpected behaviour: i was hoping to be able
to use several database connections to the same mysql server (and same
user) in order to be able to issue several LOCK TABLE or GET_LOCK() queries
(mysql allows only one 'active' lock per connection)

[I know basic locking may be done on php server's system level, but it
doesn't make sense in web-cluster environment, and using a database to
centralize locks sounds interesting]

I also took a look into php's mysql api source (i'm not familiar with php
sources), and adding an optional argument saying _not_ to reuse a
connection or coding an alternative mysql_connect() from the existing one
doesnt _seem_ to be a long or complicated task.

I _might_ do the change myself for my server, but as the sites i'm working
on are unlikely to be hosted on my server, this is not very portable and
would be probably useless.

Please tell me what you think about this issue, and if a change to
mysql_connect() function is conceivable (in that case i'd be glad to do the
change myself and send you the result :)

Thanks
-- vedad

-- 
Edit bug report at: http://bugs.php.net/?id=12985&edit=1


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to