Req #19974 [Opn]: force close persistent SQL connections
| From: | uw@php.net | Date: | Thu, 06 Jan 2011 16:20:28 +0000 |
| Subject: | Req #19974 [Opn]: force close persistent SQL connections | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-157698@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=19974&edit=1
ID: 19974
Updated by: uw@php.net
Reported by: artem at osp dot ru
Summary: force close persistent SQL connections
Status: Open
Type: Feature/Change Request
Package: MySQL related
Operating System: Linux
PHP Version: 4.2.3
-Assigned To:
+Assigned To: mysql
Block user comment: N
Private report: N
New Comment:
... don't think we should do anything on it. That magic new function is
mysql_change_user, its called by default with mysqli to clean up
connection, its exported in the mysqli API. People should just move
forward to mysqli.
Previous Comments:
------------------------------------------------------------------------
[2002-10-21 02:53:14] artem at osp dot ru
You can call it function
'mysql_reset_connection' or 'mysql_pclose', as you like.
Of course, the target of this function is close those disadvantages,
which you list.
------------------------------------------------------------------------
[2002-10-18 08:46:40] georg@php.net
When you have a pclose, there is no need for pconnect, you
can also use mysql_connect.
Currently the problem is, that persistent connections in
MySQL have some disadvantages/bugs/problems:
- no unset for user variables
- session variables are not restored to global variables
- no unlock for tables
- unselect previous selected database
- temporary tables are not deleted
- ROLLBACK of not commited transactions
- SQL_FOUND_ROWS returns a valid result
currently MySQL AB works on a new api-function
mysql_reset_connection to fix all these things, so we have
to wait. Currently there is not enough functionality to
fix/handle this inside the mysql extension.
------------------------------------------------------------------------
[2002-10-18 07:13:16] artem at osp dot ru
From time to time I need close my SQL connections becose using Lock,
temporary tables, etc. But such code executed rare.
Can you add new function?
like:
bool mysql_pclose ([bool on_script_exit_or_now=FALSE,[resource
link_identifier]])
This function will allow easy using locks and temporary tables and do
not loose efficiency.
using this function can be such:
------
mysql_pconnent(...);
...
if(rare_case) {
mysql_pclose(TRUE); # close connect at exit
mysql_query("create temporary table ....");
...
}
-----
or such:
------
mysql_pconnent(...);
...
if(rare_case) {
mysql_query("create temporary table ....");
...
mysql_pclose(); # close connect now
}
-----
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=19974&edit=1