|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-11-02 09:08 UTC] derick@php.net
[2004-11-02 09:19 UTC] fujimoto@php.net
[2004-11-03 14:36 UTC] tony2001@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 10:00:01 2025 UTC |
Description: ------------ 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 1.183.2.15 diff -r1.183.2.15 oci8.c 2479c2479 < if (! OCI(shutdown)) { --- > if (!OCI(shutdown) && !session->persistent) { Reproduce code: --------------- <?php $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.