mysql_pconnect / persistent database conections

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Been meaning to investigate persistent database connections for a
while.  Coming from a rdbms background (oracle with a bit of whatcom
sqlanywhare) I have always felt that the overhead of opening a
connection at the beginning of each page was a little resource
intensive.

Anyway, I found mysql_pconnect and this sounds like just the ticket. 
Seems that I can just change my connect method from mysql_connect to
mysql_pconnect and it will just work.

I do have a couple of questions.  Firstly what is the story with
mysql_close.  There is no mysql_pclose.  I guess you don't need to
close the connection at the end of each page but what if you do.   Is
mysql_close ignored if the connection was made with mysql_pconnect or
douse it close the connection and next time mysql_pconnect is run it
reconnects causing no benefit over mysql_pconnect.  also what is the
timeout likely to be?

My other question is what happens if lots of people connect using the
same user/password.  I tend to do my own user management so everybody
douse.  Is doing my own user management really dodge, if we were
talking about oracle I would probably say it is.

Ben
-- 
Ben Edwards - Poole, UK, England
WARNING:This email contained partisan views - dont ever accuse me of
using the veneer of objectivity
If you have a problem emailing me use
http://www.gurtlush.org.uk/profiles.php?uid=4
(email address this email is sent from may be defunct)

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux