#19974 [Opn]: force close persistent SQL connections
| From: | georg@php.net | Date: | Fri, 18 Oct 2002 13:46:40 +0000 |
| Subject: | #19974 [Opn]: force close persistent SQL connections | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-22769@lists.php.net to get a copy of this message | ||
ID: 19974
Updated by: georg@php.net
Reported By: artem@osp.ru
Status: Open
Bug Type: Feature/Change Request
Operating System: Linux
PHP Version: 4.2.3
New Comment:
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.
Previous Comments:
------------------------------------------------------------------------
[2002-10-18 07:13:16] artem@osp.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/?id=19974&edit=1