|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #30654 OCIPLogon always creates new connection with OCINLogon
Submitted: 2004-11-02 04:30 UTC Modified: 2004-11-03 14:36 UTC
From: Assigned: tony2001 (profile)
Status: Closed Package: OCI8 related
PHP Version: 4.3.9 OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
27 + 7 = ?
Subscribe to this entry?

 [2004-11-02 04:30 UTC]
OCIPLogon always creates new connection even if the process
already has the connectoin with same user, same password 
and same sid, when it's called with OCINLogon.

This happens when I called OCINLogon after OCIPLogon with
same user, password and sid as OCIPLogon
(please see also following "Reproduce code").

I'm not sure why but when php is trying to shutting down
the resource created by OCINLogon, _oci_close_session()
remove the entry in OCI(user). And then of course,
_oci_open_session() called by OCIPLogon cannot find entry
in OCI(uesr) and creates new connection next time...

and the fix will be something like this?

Index: oci8.c
RCS file: /repository/php-src/ext/oci8/oci8.c,v
retrieving revision
diff -r1.183.2.15 oci8.c
<       if (! OCI(shutdown)) {
>       if (!OCI(shutdown) && !session->persistent) {

Reproduce code:
$ora_user = "foo";
$ora_password = "bar";
$ora_sid = "blabla";
$conn_p = OCIPLogon($ora_user, $ora_password, $ora_sid);
$conn_n = OCINLogon($ora_user, $ora_password, $ora_sid);

Expected result:
OCIPLogon does not create new connection more than once,
and returns the connection created in previous execution.

Actual result:
OCIPLogon creates new connection everytime. You can confirm
this in v$session table.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2004-11-02 09:08 UTC]
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at and the instructions on how to report
a bug at

Only connections created with the persistent versoin of the logon function are recorded, just like with any other database extension. No bug here.
 [2004-11-02 09:19 UTC]
I believe you are misunderstanding my words. I know you are
fed up with a lot of bogus bugs but this one's not.

The problem here is the recorded entry which created by
OCI*P*Logon is deleted by the destructor of the connection
created by OCI*N*Logon (in case both of them are created with 
same user, password, sid).

I do not mean such a simple matter as you wrote... (although
the cause of this problem is rather simple one:)

 [2004-11-03 14:36 UTC]
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
Thank you for the report, and for helping us make PHP better.

Fixed, thanks!

PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Wed May 31 04:03:40 2023 UTC