ID:               19974
 Comment by:       [EMAIL PROTECTED]
 Reported By:      [EMAIL PROTECTED]
 Status:           Open
 Bug Type:         Feature/Change Request
 Operating System: Linux
 PHP Version:      4.2.3
 New Comment:

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.


Previous Comments:
------------------------------------------------------------------------

[2002-10-18 08:46:40] [EMAIL PROTECTED]

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] [EMAIL PROTECTED]

>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

Reply via email to