Bug #61502 [Com]: pdo_oci persistent connections broken with Oracle 9.2 servers
Edit report at https://bugs.php.net/bug.php?id=61502&edit=1
ID: 61502
Comment by: 34557049 at qq dot com
Reported by: andre at tomt dot net
Summary: pdo_oci persistent connections broken with Oracle
9.2 servers
Status: Open
Type: Bug
Package: PDO OCI
Operating System: Ubuntu 12.04
PHP Version: 5.4.0
Block user comment: N
Private report: N
New Comment:
WINDOW 64BIT APACHE2.4 PHP Version 5.5.12
class LocalSoapClient extends \SoapClient
{
public $server = '';
function __construct($wsdl, $options) {
parent::__construct($wsdl, $options);
$this->server = new \SoapServer($wsdl, $options);
// $this->server->addFunction('Add');
$this->server->setClass('App\Libaraies\HelloWorld');
}
function __doRequest($request, $location, $action, $version, $one_way = 0) {
ob_start();
$this->server->handle($request);
$response = ob_get_contents();
ob_end_clean();
return $response;
}
}
ErrorException in LocalSoapClient.php line 22: SoapServer::setClass(): Tried to set a non existent
class (App\Libaraies\HelloWorld)
使ç¨çæ¯laravel5.1,æ æ³è°ç¨è·¯å¾ä¸çç±»åºï¼æ¾å¨laravelæ¡æ¶å¤é¨ï¼ç´æ¥åsetClass('HelloWorld')æ¯è½è°å°è¿ä¸ªHelloWorldç±»ç
Previous Comments:
------------------------------------------------------------------------
[2012-03-26 17:47:59] sixd@php.net
Check you have the latest Oracle DB patchset 9.2.0.8 and latest Oracle
11.2 client. Look for Oracle traces. Utilize Oracle Support to
identify the cause and find a remedy. I've not seen other reports of
problems. Does the OCI8 extension have the same problem?
OCIServerVersion and OCIPing check different things. The latter can
check more to provide better reliability. If your same PHP code
connects to multiple Oracle DB versions, perhaps you could modify the
PDO_OCI source and add a runtime check to determine which function to
use?
Oracle 9.2 was released in 2002. Oracle's Extended Support for it
finished in 2010. (Ref:
http://www.oracle.com/us/support/library/lifetime-support-technology-
069183.pdf)
The PDO_OCI extension currently does not have a maintainer. The
OCI8 extension does, and has better functionality. Using OCI8
is preferred.
------------------------------------------------------------------------
[2012-03-24 22:55:45] andre at tomt dot net
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 this bug report at https://bugs.php.net/bug.php?id=61502&edit=1
Thread (5 messages)