From: [EMAIL PROTECTED] Operating system: Linux PHP version: 4.3.9 PHP Bug Type: OCI8 related Bug description: OCIPLogon always creates new connection with OCINLogon
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. -- Edit bug report at http://bugs.php.net/?id=30654&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=30654&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=30654&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=30654&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=30654&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=30654&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=30654&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=30654&r=needscript Try newer version: http://bugs.php.net/fix.php?id=30654&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=30654&r=support Expected behavior: http://bugs.php.net/fix.php?id=30654&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=30654&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=30654&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=30654&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=30654&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=30654&r=dst IIS Stability: http://bugs.php.net/fix.php?id=30654&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=30654&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=30654&r=float MySQL Configuration Error: http://bugs.php.net/fix.php?id=30654&r=mysqlcfg