From: Operating system: Ubuntu 12.04 PHP version: 5.4.0 Package: PDO related Bug Type: Bug Bug description:pdo_oci persistent connections broken with Oracle 9.2 servers
Description: ------------ I've only verified this in PHP 5.3.10, but I checked that the relevant code has not changed in git/master. Enabling persistent connection to Oracle 9.2 servers does not work. The server seem to brutally kill the connection on OCIPing, a function the code in ext/pdo/oci_driver.c:pdo_oci_check_liveness() assumes will fail gracefully on older Oracle versions. This makes the error_code == 1010 check fail and it will (now correctly) re-connect to the server, saving the day by not failing in a user-visible way, but however rendering persistent connections to 9.2 servers useless and adding ~900ms of extra latency (in our case). I tried extending the check to the resulting 3113 (end-of-file on communication channel) error, but it turned out the connection really is dead at that point. Is there really any downside to just using OCIServerVersion instead of OCIPing? Test script: --------------- <?php $pdo = new PDO( 'oci:dbname=//dbserver/dbname', 'user', 'pass', array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, PDO::ATTR_PERSISTENT => true) ); ?> Expected result: ---------------- connections not beeing re-established (source port numbers in netstat -anp not changing) Actual result: -------------- connections beeing re-established (source port numbers in netstat -anp changing), incurring a large latency penalty. -- Edit bug report at https://bugs.php.net/bug.php?id=61502&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=61502&r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=61502&r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=61502&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=61502&r=fixed Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=61502&r=needdocs Fixed in release: https://bugs.php.net/fix.php?id=61502&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=61502&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=61502&r=needscript Try newer version: https://bugs.php.net/fix.php?id=61502&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=61502&r=support Expected behavior: https://bugs.php.net/fix.php?id=61502&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=61502&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=61502&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=61502&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=61502&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=61502&r=dst IIS Stability: https://bugs.php.net/fix.php?id=61502&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=61502&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=61502&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=61502&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=61502&r=mysqlcfg