Ask a Question related to PHP Bugs, Design and Development.
-
frmi at freemail dot hu #1
#40681 [NEW]: Unable to close persistent connection
From: frmi at freemail dot hu
Operating system: linux
PHP version: 5.2.1
PHP Bug Type: *Database Functions
Bug description: Unable to close persistent connection
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 bug report at [url]http://bugs.php.net/?id=40681&edit=1[/url]
--
Try a CVS snapshot (PHP 4.4): [url]http://bugs.php.net/fix.php?id=40681&r=trysnapshot44[/url]
Try a CVS snapshot (PHP 5.2): [url]http://bugs.php.net/fix.php?id=40681&r=trysnapshot52[/url]
Try a CVS snapshot (PHP 6.0): [url]http://bugs.php.net/fix.php?id=40681&r=trysnapshot60[/url]
Fixed in CVS: [url]http://bugs.php.net/fix.php?id=40681&r=fixedcvs[/url]
Fixed in release: [url]http://bugs.php.net/fix.php?id=40681&r=alreadyfixed[/url]
Need backtrace: [url]http://bugs.php.net/fix.php?id=40681&r=needtrace[/url]
Need Reproduce Script: [url]http://bugs.php.net/fix.php?id=40681&r=needscript[/url]
Try newer version: [url]http://bugs.php.net/fix.php?id=40681&r=oldversion[/url]
Not developer issue: [url]http://bugs.php.net/fix.php?id=40681&r=support[/url]
Expected behavior: [url]http://bugs.php.net/fix.php?id=40681&r=notwrong[/url]
Not enough info: [url]http://bugs.php.net/fix.php?id=40681&r=notenoughinfo[/url]
Submitted twice: [url]http://bugs.php.net/fix.php?id=40681&r=submittedtwice[/url]
register_globals: [url]http://bugs.php.net/fix.php?id=40681&r=globals[/url]
PHP 3 support discontinued: [url]http://bugs.php.net/fix.php?id=40681&r=php3[/url]
Daylight Savings: [url]http://bugs.php.net/fix.php?id=40681&r=dst[/url]
IIS Stability: [url]http://bugs.php.net/fix.php?id=40681&r=isapi[/url]
Install GNU Sed: [url]http://bugs.php.net/fix.php?id=40681&r=gnused[/url]
Floating point limitations: [url]http://bugs.php.net/fix.php?id=40681&r=float[/url]
No Zend Extensions: [url]http://bugs.php.net/fix.php?id=40681&r=nozend[/url]
MySQL Configuration Error: [url]http://bugs.php.net/fix.php?id=40681&r=mysqlcfg[/url]
frmi at freemail dot hu Guest
-
#26117 [Fbk->Opn]: Persistent connection not reused
ID: 26117 User updated by: spam at vrana dot cz Reported By: spam at vrana dot cz -Status: Feedback +Status: ... -
#26117 [Opn->Fbk]: Persistent connection not reused
ID: 26117 Updated by: iliaa@php.net Reported By: spam at vrana dot cz -Status: Open +Status: ... -
#26117 [NEW]: Persistent connection not reused
From: spam at vrana dot cz Operating system: Linux PHP version: 4.3.3 PHP Bug Type: MySQL related Bug description: ... -
Maintains a persistent connection
Greetings, Could I use the PHP to maintain a persistent connection with MySQL database? My persistent connection here should work in this way:... -
[PHP] Maintains a persistent connection
--- ascll <ascll@yahoo.com> wrote: Yes: www.php.net/mysql_pconnect That makes no sense to me. Chris -
tony2001@php.net #2
#40681 [Opn->Fbk]: Unable to close persistent connection
ID: 40681
Updated by: [email]tony2001@php.net[/email]
Reported By: frmi at freemail dot hu
-Status: Open
+Status: Feedback
Bug Type: *Database Functions
Operating System: linux
PHP Version: 5.2.1
New Comment:
Could you please elaborate? What kind of cases?>In some cases I want to close the connection and reconnect.
One of the reason why persistent connections are called "persistent" is>what to do, when it must be closed?
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.
Previous Comments:
------------------------------------------------------------------------
[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 [url]http://bugs.php.net/?id=40681&edit=1[/url]
tony2001@php.net Guest
-
frmi at freemail dot hu #3
#40681 [Fbk->Opn]: Unable to close persistent connection
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:
Sure.>Could you please elaborate? What kind of cases?>>In some cases I want to close the connection and reconnect.
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.
is that you cannot close them.>One of the reason why persistent connections are called "persistent">>what to do, when it must be closed?imagine why) - don't use persistent connections or restart Apache.>So if you really need to close the connection and reopen it (I can't
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] [email]tony2001@php.net[/email]
Could you please elaborate? What kind of cases?>In some cases I want to close the connection and reconnect.
One of the reason why persistent connections are called "persistent" is>what to do, when it must be closed?
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 [url]http://bugs.php.net/?id=40681&edit=1[/url]
frmi at freemail dot hu Guest
-
tony2001@php.net #4
#40681 [Opn->Bgs]: Unable to close persistent connection
ID: 40681
Updated by: [email]tony2001@php.net[/email]
Reported By: frmi at freemail dot hu
-Status: Open
+Status: Bogus
Bug Type: *Database Functions
Operating System: linux
PHP Version: 5.2.1
New Comment:
at will.>Persistent connection is a choice for enabling a better performance.
>Eg. keepalive in http. It should not disable the right to disconnect
Well, face it then.
I believe you're fixing wrong problem.
You should fix mystic behaviour of oracle first.
Previous Comments:
------------------------------------------------------------------------
[2007-03-01 18:09:34] frmi at freemail dot hu
Sure.>Could you please elaborate? What kind of cases?>>In some cases I want to close the connection and reconnect.
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.
is that you cannot close them.>One of the reason why persistent connections are called "persistent">>what to do, when it must be closed?imagine why) - don't use persistent connections or restart Apache.>So if you really need to close the connection and reopen it (I can't
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.
------------------------------------------------------------------------
[2007-03-01 16:57:13] [email]tony2001@php.net[/email]
Could you please elaborate? What kind of cases?>In some cases I want to close the connection and reconnect.
One of the reason why persistent connections are called "persistent" is>what to do, when it must be closed?
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 [url]http://bugs.php.net/?id=40681&edit=1[/url]
tony2001@php.net Guest
-
frmi at freemail dot hu #5
#40681 [Bgs]: Unable to close persistent connection
ID: 40681
User updated by: frmi at freemail dot hu
Reported By: frmi at freemail dot hu
Status: Bogus
Bug Type: *Database Functions
Operating System: linux
PHP Version: 5.2.1
New Comment:
Face what?>I believe you're fixing wrong problem.
>You should fix mystic behaviour of oracle first.
Good joke.
Easy to say that instead of telling a solution.
I've such experience, even solved bug in oracle software just surfing
source code, but at first waiting few months for the solution from
oracle support.
I think oci_pclose would be good, no reason of not having that.
And it is a bit easier then solving all oracle bugs.
Previous Comments:
------------------------------------------------------------------------
[2007-03-01 18:30:19] [email]tony2001@php.net[/email]
at will.>Persistent connection is a choice for enabling a better performance.
>Eg. keepalive in http. It should not disable the right to disconnect
Well, face it then.
I believe you're fixing wrong problem.
You should fix mystic behaviour of oracle first.
------------------------------------------------------------------------
[2007-03-01 18:09:34] frmi at freemail dot hu
Sure.>Could you please elaborate? What kind of cases?>>In some cases I want to close the connection and reconnect.
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.
is that you cannot close them.>One of the reason why persistent connections are called "persistent">>what to do, when it must be closed?imagine why) - don't use persistent connections or restart Apache.>So if you really need to close the connection and reopen it (I can't
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.
------------------------------------------------------------------------
[2007-03-01 16:57:13] [email]tony2001@php.net[/email]
Could you please elaborate? What kind of cases?>In some cases I want to close the connection and reconnect.
One of the reason why persistent connections are called "persistent" is>what to do, when it must be closed?
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 [url]http://bugs.php.net/?id=40681&edit=1[/url]
frmi at freemail dot hu Guest
-
frmi at freemail dot hu #6
#40681 [Bgs->Opn]: Unable to close persistent connection
ID: 40681
User updated by: frmi at freemail dot hu
Reported By: frmi at freemail dot hu
-Status: Bogus
+Status: Open
Bug Type: *Database Functions
Operating System: linux
PHP Version: 5.2.1
New Comment:
It's unfriendly to set status to bogus without having reason for that.
Even the documentation says that starting from the version 1.1
oci_close() correctly closes the Oracle connection.
Not mentioning that it is not true for persistent connection.
Please be collaborative.
Previous Comments:
------------------------------------------------------------------------
[2007-03-01 19:22:20] frmi at freemail dot hu
Face what?>I believe you're fixing wrong problem.
>You should fix mystic behaviour of oracle first.
Good joke.
Easy to say that instead of telling a solution.
I've such experience, even solved bug in oracle software just surfing
source code, but at first waiting few months for the solution from
oracle support.
I think oci_pclose would be good, no reason of not having that.
And it is a bit easier then solving all oracle bugs.
------------------------------------------------------------------------
[2007-03-01 18:30:19] [email]tony2001@php.net[/email]
at will.>Persistent connection is a choice for enabling a better performance.
>Eg. keepalive in http. It should not disable the right to disconnect
Well, face it then.
I believe you're fixing wrong problem.
You should fix mystic behaviour of oracle first.
------------------------------------------------------------------------
[2007-03-01 18:09:34] frmi at freemail dot hu
Sure.>Could you please elaborate? What kind of cases?>>In some cases I want to close the connection and reconnect.
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.
is that you cannot close them.>One of the reason why persistent connections are called "persistent">>what to do, when it must be closed?imagine why) - don't use persistent connections or restart Apache.>So if you really need to close the connection and reopen it (I can't
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.
------------------------------------------------------------------------
[2007-03-01 16:57:13] [email]tony2001@php.net[/email]
Could you please elaborate? What kind of cases?>In some cases I want to close the connection and reconnect.
One of the reason why persistent connections are called "persistent" is>what to do, when it must be closed?
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 [url]http://bugs.php.net/?id=40681&edit=1[/url]
frmi at freemail dot hu Guest
-
tony2001@php.net #7
#40681 [Opn->Bgs]: Unable to close persistent connection
ID: 40681
Updated by: [email]tony2001@php.net[/email]
Reported By: frmi at freemail dot hu
-Status: Open
+Status: Bogus
Bug Type: *Database Functions
Operating System: linux
PHP Version: 5.2.1
New Comment:
All persistent connections are not affected by *_close() functions,>Even the documentation says that starting from the version 1.1
>oci_close() correctly closes the Oracle connection.
>Not mentioning that it is not true for persistent connection.
it's not something OCI8 specific.
MySQL persistent connections cannot be closed by mysql_close() etc.
etc.
PHP behaves this way since the very introduction of persistent
connections, and I doubt this is a subject to change in the future,
since it'd destroy whole concept of "persistency".
Hence the status of the report.
Previous Comments:
------------------------------------------------------------------------
[2007-03-01 19:38:29] frmi at freemail dot hu
It's unfriendly to set status to bogus without having reason for that.
Even the documentation says that starting from the version 1.1
oci_close() correctly closes the Oracle connection.
Not mentioning that it is not true for persistent connection.
Please be collaborative.
------------------------------------------------------------------------
[2007-03-01 19:22:20] frmi at freemail dot hu
Face what?>I believe you're fixing wrong problem.
>You should fix mystic behaviour of oracle first.
Good joke.
Easy to say that instead of telling a solution.
I've such experience, even solved bug in oracle software just surfing
source code, but at first waiting few months for the solution from
oracle support.
I think oci_pclose would be good, no reason of not having that.
And it is a bit easier then solving all oracle bugs.
------------------------------------------------------------------------
[2007-03-01 18:30:19] [email]tony2001@php.net[/email]
at will.>Persistent connection is a choice for enabling a better performance.
>Eg. keepalive in http. It should not disable the right to disconnect
Well, face it then.
I believe you're fixing wrong problem.
You should fix mystic behaviour of oracle first.
------------------------------------------------------------------------
[2007-03-01 18:09:34] frmi at freemail dot hu
Sure.>Could you please elaborate? What kind of cases?>>In some cases I want to close the connection and reconnect.
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.
is that you cannot close them.>One of the reason why persistent connections are called "persistent">>what to do, when it must be closed?imagine why) - don't use persistent connections or restart Apache.>So if you really need to close the connection and reopen it (I can't
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.
------------------------------------------------------------------------
[2007-03-01 16:57:13] [email]tony2001@php.net[/email]
Could you please elaborate? What kind of cases?>In some cases I want to close the connection and reconnect.
One of the reason why persistent connections are called "persistent" is>what to do, when it must be closed?
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.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
[url]http://bugs.php.net/40681[/url]
--
Edit this bug report at [url]http://bugs.php.net/?id=40681&edit=1[/url]
tony2001@php.net Guest
-
frmi at freemail dot hu #8
#40681 [Bgs]: Unable to close persistent connection
ID: 40681
User updated by: frmi at freemail dot hu
Reported By: frmi at freemail dot hu
Status: Bogus
Bug Type: *Database Functions
Operating System: linux
PHP Version: 5.2.1
New Comment:
OK.
I see I'll have no success with you.
But you are surely wrong.
The base concept is ok, but it is a little confusing.
If there is pconnect, then there should be pclose.
No place to doubt.
If the concept is sooooo persistent as you say,
and really there must be no pclose, then there must be no pconnect.
I could understand this as well.
Then the connection could be a configured one and it would be opened
when trying to use it, or at script startup.
But I think this would be topo strong.
I cannot understand why a pclose would destroy concept of persistency.
It is simply not true.
And the problem is, that with denying a small bit of code to complete
the concept, there are lots of problems which cannot be handled.
Previous Comments:
------------------------------------------------------------------------
[2007-03-01 19:47:51] [email]tony2001@php.net[/email]
All persistent connections are not affected by *_close() functions,>Even the documentation says that starting from the version 1.1
>oci_close() correctly closes the Oracle connection.
>Not mentioning that it is not true for persistent connection.
it's not something OCI8 specific.
MySQL persistent connections cannot be closed by mysql_close() etc.
etc.
PHP behaves this way since the very introduction of persistent
connections, and I doubt this is a subject to change in the future,
since it'd destroy whole concept of "persistency".
Hence the status of the report.
------------------------------------------------------------------------
[2007-03-01 19:38:29] frmi at freemail dot hu
It's unfriendly to set status to bogus without having reason for that.
Even the documentation says that starting from the version 1.1
oci_close() correctly closes the Oracle connection.
Not mentioning that it is not true for persistent connection.
Please be collaborative.
------------------------------------------------------------------------
[2007-03-01 19:22:20] frmi at freemail dot hu
Face what?>I believe you're fixing wrong problem.
>You should fix mystic behaviour of oracle first.
Good joke.
Easy to say that instead of telling a solution.
I've such experience, even solved bug in oracle software just surfing
source code, but at first waiting few months for the solution from
oracle support.
I think oci_pclose would be good, no reason of not having that.
And it is a bit easier then solving all oracle bugs.
------------------------------------------------------------------------
[2007-03-01 18:30:19] [email]tony2001@php.net[/email]
at will.>Persistent connection is a choice for enabling a better performance.
>Eg. keepalive in http. It should not disable the right to disconnect
Well, face it then.
I believe you're fixing wrong problem.
You should fix mystic behaviour of oracle first.
------------------------------------------------------------------------
[2007-03-01 18:09:34] frmi at freemail dot hu
Sure.>Could you please elaborate? What kind of cases?>>In some cases I want to close the connection and reconnect.
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.
is that you cannot close them.>One of the reason why persistent connections are called "persistent">>what to do, when it must be closed?imagine why) - don't use persistent connections or restart Apache.>So if you really need to close the connection and reopen it (I can't
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.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
[url]http://bugs.php.net/40681[/url]
--
Edit this bug report at [url]http://bugs.php.net/?id=40681&edit=1[/url]
frmi at freemail dot hu Guest



Reply With Quote

