#40681 [Fbk->Opn]: Unable to close persistent connection
| From: | frmi at freemail dot hu | Date: | Thu, 01 Mar 2007 18:09:34 +0000 |
| Subject: | #40681 [Fbk->Opn]: Unable to close persistent connection | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-109762@lists.php.net to get a copy of this message | ||
ID: 40681
User updated by: frmi at freemail dot hu
Reported By: frmi at freemail dot hu
-Status: Feedback
+Status: Open
Bug Type: *Database Functions
Operating System: linux
PHP Version: 5.2.1
New Comment:
>>In some cases I want to close the connection and reconnect.
>Could you please elaborate? What kind of cases?
Sure.
Eg. some mystic behaviour of oracle or the developed system, which can
be resolved by simple reconnect, until bug is found and resolved. It
happens that it is needed.
>>what to do, when it must be closed?
>One of the reason why persistent connections are called "persistent"
is that you cannot close them.
>So if you really need to close the connection and reopen it (I can't
imagine why) - don't use persistent connections or restart Apache.
I cannot belive that. Persistent connection is a choice for enabling a
better performance. Eg. keepalive in http. It should not disable the
right to disconnect at will.
I think closing the user app is users choice, closing or freeing apps
sessions or variables is developers choice.
Restarting apache disturbs other users, while disconnecting just one
user doesn't.
I can understand if you say that oci_close must not disconnect the
session, but then a oci_pclose would be nice.
Previous Comments:
------------------------------------------------------------------------
[2007-03-01 16:57:13] tony2001@php.net
>In some cases I want to close the connection and reconnect.
Could you please elaborate? What kind of cases?
>what to do, when it must be closed?
One of the reason why persistent connections are called "persistent" is
that you cannot close them.
So if you really need to close the connection and reopen it (I can't
imagine why) - don't use persistent connections or restart Apache.
------------------------------------------------------------------------
[2007-03-01 16:41:00] frmi at freemail dot hu
Description:
------------
I must use persistent oci8 connection to oracle, because of high load.
In some cases I want to close the connection and reconnect.
Is it possible somehow?
The oci_close seems not to close the connection.
I understand that the persistent connection was implemented to stay for
reuse, but what to do, when it must be closed?
Reproduce code:
---------------
$conn=OCI_connect($user,$pwd,$db);
...
oci_close($conn);
$conn=OCI_connect($user,$pwd,$db);
still uses the old oracle session
Expected result:
----------------
Should disconnect from oracle db, and create a new connection.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=40681&edit=1