#29902 [Bgs->Csd]: oci8 doesn't disconnect sessions, overloads oracle server

From: Date: Thu, 08 Sep 2005 09:49:56 +0000
Subject: #29902 [Bgs->Csd]: oci8 doesn't disconnect sessions, overloads oracle server
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-84708@lists.php.net to get a copy of this message
ID: 29902 Updated by: tony2001@php.net Reported By: jwoodrich at avaya dot com -Status: Bogus +Status: Closed Bug Type: OCI8 related Operating System: Solaris 7 PHP Version: 5.0.1 New Comment: The bug has been fixed in OCI8 v.1.1, which is available in CVS HEAD and PECL (use pear install oci8-beta to install it). Previous Comments: ------------------------------------------------------------------------ [2004-08-31 07:16:28] tony2001@php.net OCI8 module doesn't close connections and leaves this duty to the Oracle server. That was done intentionally long time ago and that's how it works. Currently all OCI8 connections are persistent (except those established with oci_new_connect()/ocinlogon()), i.e. most often you will have one OCI8 connection for each Apache child. You should tune your Oracle to be able to close connections after a timeout. Look here http://php.net/oci_close for additional info. ------------------------------------------------------------------------ [2004-08-30 20:54:50] jwoodrich at avaya dot com Description: ------------ PHP's oci8 opens connections to the database server but does not disconnect. This appears to be done for each instance of apache that uses PHP oci8. Eventually the maximum number of sessions is reached on the database server and no more connections can be made. This has occured on three different Solaris servers (two v7 and one v8) running PHP 5.0.1. After downgrading to PHP 4.3.8 the problem disappeared and connections disappeared from session listing in Oracle as web transactions completed. Config line: ./configure --with-apxs --with-oci8 \ --enable-ftp --with-curl --with-informix \ --with-imap \ --with-ldap --with-gd --with-jpeg- \ --with-pgsql \ --with-libxml-dir \ --prefix \ --with-png-dir --with-zlib --enable-pcntl --disable-debug Oracle Server version: 8.1.7.2 Oracle Client version: 8.1.7 Reproduce code: --------------- Example: $dbh=ocilogon("LOGIN","PASSWORD","DATABASE"); $sth=ociparse($dbh,"select sysdate from dual"); ociexecute($sth); ocifetchinto($sth,&$svret,OCI_ASSOC+OCI_RETURN_NULLS); ocifreestatement($sth); oci_close($dbh); var_dump($svret); Expected result: ---------------- array(1) { ["SYSDATE"]=>string(11) "<<the time>>" } Actual result: -------------- Once the maximum number of sessions is reached this error message is returned: ORA-00604: error occurred at recursive SQL level 1 ORA-00018: maximum number of sessions exceeded ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=29902&edit=1

« previous php.bugs (#84708) next »