|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-09-30 07:56 UTC] tony2001 at phpclub dot net
[2005-10-03 09:02 UTC] tony2001 at phpclub dot net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 23:00:01 2025 UTC |
Description: ------------ My application needs to open several isolated connections to the same Oracle database and to close them when done. To obtain this I use oci_new_connect() call and oci_close() when done. I can notice an increasing number of open sessions on oracle side. Install & test procedure followed: Got php-5.1.0RC1.tar.gz and oci8-1.1.1.tgz unpack php-5.1.0RC1.tar.gz unpack oci8-1.1.1.tgz in ./ext cd <php source home> rm -rf ext/oci8 mv ext/oci8-1.1.1 ext/oci8 rm -f ext/package.xml ./buildconf --force # it complains without force INCLUDES="-I/usr/kerberos/include" ./configure \ --with-apxs2=/home/wadmin/apache/bin/apxs \ --prefix=/home/wadmin/apache/php4module \ --with-config-file-path=/home/wadmin/apache/php4module \ --disable-cgi \ \ --with-gdbm \ --with-gd \ --with-ttf \ --enable-gd-native-ttf \ --with-t1lib \ --with-libxml-dir=/home/wadmin/apache/php4module \ \ --with-mysql \ --with-oci8=/home/wadmin/9i/product/9.2.0 \ --with-zlib \ --with-pear \ \ --enable-soap \ --enable-sigchild \ --enable-ftp \ --enable-safe-mode \ --enable-magic-quotes \ --enable-shmop \ --enable-memory-limit \ \ --without-sqlite \ --disable-spl \ \ --with-xmlrpc \ --with-openssl \ --with-pcntl \ --disable-ipv6 \ --enable-pcntl make make install [No oci.* options are in my php.ini] [run test script] Reproduce code: --------------- #!/home/wadmin/apache/php4module/bin/php <? ini_set('oci8.max_persistent', 3) ; $o_user = 'SCOTT' ; $o_pwd = 'TIGER'; $o_instance = 'FOOBAR' ; for ($iloop=0; $iloop < 4; $iloop++) { printf("PID %d: User %s on %s\n", posix_getpid(), $o_user, $o_instance) ; $oconn = oci_new_connect( $o_user, $o_pwd, $o_instance); $epa = oci_parse($oconn, sprintf( 'select sid, username, machine, program, process, to_char(LOGON_TIME, \'YYYYMMDD HH24:MI:SS\') as login_time from v$session where SCHEMANAME = \'%s\'', $o_user)); $eex = oci_execute($epa); $n_rows = oci_fetch_all($epa, $risultati, 0, -1, OCI_FETCHSTATEMENT_BY_ROW); foreach ($risultati as $irow => $rset) { foreach ($rset as $campo => $valore) { printf("%s='%s', ", $campo, $valore) ; } print "\n" ; } print "\n" ; oci_free_statement($epa); oci_close($oconn) ; sleep(5) ; // wait before next connection } ?> Expected result: ---------------- I expect to have always only ONE line of output referring my PID and my MACHINE. The new oci_close() doc page states: oci_close() closes the Oracle connection connection. Note: Starting from the version 1.1 oci_close() correctly closes the Oracle connection. Actual result: -------------- # connections survive to oci_close(): PHP Warning: Zend Optimizer does not support this version of PHP - please upgrade to the latest version of Zend Optimizer in Unknown on line 0 PID 7663: User SCOTT on FOOBAR SID='78', USERNAME='SCOTT', MACHINE='clienthost.mydom.it', PROGRAM='php@clienthost.mydom.it (TNS V1-', PROCESS='7663', LOGIN_TIME='20050930 11:31:48', PID 7663: User SCOTT on FOOBAR SID='78', USERNAME='SCOTT', MACHINE='clienthost.mydom.it', PROGRAM='php@clienthost.mydom.it (TNS V1-', PROCESS='7663', LOGIN_TIME='20050930 11:31:48', SID='110', USERNAME='SCOTT', MACHINE='clienthost.mydom.it', PROGRAM='php@clienthost.mydom.it (TNS V1-', PROCESS='7663', LOGIN_TIME='20050930 11:31:53', PID 7663: User SCOTT on FOOBAR SID='78', USERNAME='SCOTT', MACHINE='clienthost.mydom.it', PROGRAM='php@clienthost.mydom.it (TNS V1-', PROCESS='7663', LOGIN_TIME='20050930 11:31:48', SID='110', USERNAME='SCOTT', MACHINE='clienthost.mydom.it', PROGRAM='php@clienthost.mydom.it (TNS V1-', PROCESS='7663', LOGIN_TIME='20050930 11:31:53', SID='137', USERNAME='SCOTT', MACHINE='clienthost.mydom.it', PROGRAM='php@clienthost.mydom.it (TNS V1-', PROCESS='7663', LOGIN_TIME='20050930 11:31:58', PID 7663: User SCOTT on FOOBAR SID='78', USERNAME='SCOTT', MACHINE='clienthost.mydom.it', PROGRAM='php@clienthost.mydom.it (TNS V1-', PROCESS='7663', LOGIN_TIME='20050930 11:31:48', SID='109', USERNAME='SCOTT', MACHINE='clienthost.mydom.it', PROGRAM='php@clienthost.mydom.it (TNS V1-', PROCESS='7663', LOGIN_TIME='20050930 11:32:03', SID='110', USERNAME='SCOTT', MACHINE='clienthost.mydom.it', PROGRAM='php@clienthost.mydom.it (TNS V1-', PROCESS='7663', LOGIN_TIME='20050930 11:31:53', SID='137', USERNAME='SCOTT', MACHINE='clienthost.mydom.it', PROGRAM='php@clienthost.mydom.it (TNS V1-', PROCESS='7663', LOGIN_TIME='20050930 11:31:58',