#21481 [Com]: mssql_close function don't close connection

From: Date: Wed, 08 Jan 2003 09:21:16 +0000
Subject: #21481 [Com]: mssql_close function don't close connection
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-29422@lists.php.net to get a copy of this message
 ID:               21481
 Comment by:       pvy@novosoft.ru
 Reported By:      pvy@novosoft.ru
 Status:           Open
 Bug Type:         MSSQL related
 Operating System: windows 2000/sp3
 PHP Version:      4CVS-2003-01-07 (stable)
 New Comment:

Please, tell me, where in function mssql_close is dbclose call for
really close connection to database?


vladimir.


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

[2003-01-08 03:20:04] pvy@novosoft.ru

Sorry, this is my mistype.
in my test script all was fine.
and, also, I reopen this bug report.
When 25 connections was reached, no new connection will open. 
Then I change option "allow persistant" to Off in php.ini.
All working fine.

I assume this is not a bogus, this is a bug.

------------------------------------------------------------------------

[2003-01-07 05:48:56] nicos@php.net

A little comment to let pvy@novosoft.ru knows that his script is
bogus:

<? 
$db=mssql_connect("server","user","pass");
mssql_close("db");
?>

should be

<? 
$db=mssql_connect("server","user","pass");
mssql_close($db);
?>

Thank you for your report.


------------------------------------------------------------------------

[2003-01-07 05:43:01] georg@php.net

In the db extensions connections will be closed via destructor
functions, which will be called when zend_list_delete is executed:

see: PHP_MINIT_FUNCTION and _close_[extname]_link

------------------------------------------------------------------------

[2003-01-07 04:07:18] pvy@novosoft.ru

And also:
If I create file like this:
<? 
$db=mssql_connect("server","user","pass");
mssql_close("db");
?>
and run it a lot of times, after 25 times I got message "unable connect
to server" from mssql_connect
when I go to mssql entreprise manager I will see 25 connections from
PHP.
If I restart apache all connections will be closed.

PS: I use apache 1.3.27/w32

Same behavior with all databases, as I understand, there is  another
childs logic instead unix. 


Waiting for comments

------------------------------------------------------------------------

[2003-01-07 02:06:41] pvy@novosoft.ru

Hello!

I call mssql_close function for close connection
but, as I see in php_mssql.c file this function
do nothing (ie don't really closes connection)
see code:
	ZEND_FETCH_RESOURCE2(mssql_ptr, mssql_link *, mssql_link_index, id,
"MS SQL-Link", le_link, le_plink);

	if (mssql_link_index) 
  		zend_list_delete(Z_LVAL_PP(mssql_link_index));
	 else 
		zend_list_delete(id);

	RETURN_TRUE;

where is dbclose and dbfreelogin staments?


vladimir
Novosibirsk,
Russia


------------------------------------------------------------------------


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



Thread (8 messages)

« previous php.bugs (#29422) next »