|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2008-03-28 15:57 UTC] jarismar_silva at adplabs dot com dot br
[2009-04-25 14:57 UTC] jani@php.net
[2009-05-03 01:00 UTC] php-bugs at lists dot php dot net
[2009-05-04 17:02 UTC] jarismar dot php at gmail dot com
[2009-05-12 22:04 UTC] mbeccati@php.net
[2009-05-20 01:00 UTC] php-bugs at lists dot php dot net
[2016-03-08 01:43 UTC] sixd@php.net
-Package: PDO related
+Package: PDO OCI
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Nov 03 15:00:02 2025 UTC |
Description: ------------ Sometimes our DBAs restart oracle without restarting the apache server, due to this if apache has persistent connections, those connections are in invalid state. In this scenario trying to connect to oracle results in on of the following errors: ORA-00028: your session has been killed ORA-01012: not logged on ORA-03113 end-of-file on communication channel I'm trying to handle this errors and skipping creating the persistent connection and then creating a new non-persistent connection (see the php snippet). I was in hope that doing this could force apache to free the invalid persistent connection, but instead apache crashes (it seems a problem freeing the statements). Reproduce code: --------------- try { $oPDO = new PDO($sDSN, $sUserName, $sPassword, array(PDO::ATTR_PERSISTENT => true)); print "Persistent connection created\n"; $oPDO->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); } catch (Exception $oE) { echo "Error : ".$oE->getMessage()."\n"; $oPDO = new PDO($sDSN, $sUserName, $sPassword, array(PDO::ATTR_PERSISTENT => false)); print "Non persistent connection created\n"; } try { $oStatement = $oPDO->prepare('Select 1+1 as test from dual'); var_dump($oStatement->execute()); var_dump($oStatement->fetchAll()); } catch (Exception $oE) { echo "Error : ".$oE->getMessage()."\n"; } $oPDO = null; Expected result: ---------------- I expect either the system get ride of invalid persistent connections or when one create a non-peristent connection it replaces the persistent one if there is any. Actual result: -------------- Unhandled exception at 0x0087ac76 (php5ts.dll) in Apache.exe: 0xC0000005: Access violation reading location 0x002b5ffc. > php5ts.dll!_zend_mm_free_int(_zend_mm_heap * heap=0x01ded100, void * p=0x0005000c) Line 1960 C php5ts.dll!_efree(void * ptr=0x00265ff8) Line 2293 + 0xb bytes C php_pdo_oci.dll!oci_stmt_dtor(_pdo_stmt_t * stmt=0x00000000, void * * * tsrm_ls=0x01debeb0) Line 90 + 0x3 bytes C php_pdo.dll!free_statement(_pdo_stmt_t * stmt=0x02b9ad48, void * * * tsrm_ls=0x01debeb0) Line 2355 + 0x8 bytes C php_pdo.dll!php_pdo_stmt_delref(_pdo_stmt_t * stmt=0x02b9ad48, void * * * tsrm_ls=0x01debeb0) Line 2397 + 0xb bytes C php_pdo.dll!pdo_dbstmt_free_storage(_pdo_stmt_t * stmt=0x02b9ad48, void * * * tsrm_ls=0x01debeb0) Line 2402 + 0xf bytes C php5ts.dll!zend_objects_store_del_ref_by_handle(unsigned int handle=2, void * * * tsrm_ls=0x01debeb0) Line 206 + 0x11 bytes C php5ts.dll!zend_objects_store_del_ref(_zval_struct * zobject=0x02b9ab00, void * * * tsrm_ls=0x01debeb0) Line 169 C php5ts.dll!_zval_dtor_func(_zval_struct * zvalue=0x02b9ab00) Line 60 C php5ts.dll!_zval_ptr_dtor(_zval_struct * * zval_ptr=0x02b9aefc) Line 414 + 0xc bytes C php5ts.dll!zend_hash_apply_deleter(_hashtable * ht=0x01e22460, bucket * p=0x02b9aef0) Line 611 + 0x6 bytes C php5ts.dll!zend_hash_reverse_apply(_hashtable * ht=0x01e22460, int (void *, void * * *)* apply_func=0x00907bb0, void * * * tsrm_ls=0x01debeb0) Line 760 + 0xb bytes C php5ts.dll!shutdown_destructors(void * * * tsrm_ls=0x01debeb0) Line 212 C php5ts.dll!zend_call_destructors(void * * * tsrm_ls=0x01debeb0) Line 845 + 0x6 bytes C php5ts.dll!php_request_shutdown(void * dummy=0x00000000) Line 1445 + 0x6 bytes C php5apache2.dll!php_apache_request_dtor(request_rec * r=0x01bc6de0, void * * * tsrm_ls=0x01debeb0) Line 468 + 0x8 bytes C php5apache2.dll!php_handler(request_rec * r=0x01bc6de0) Line 641 + 0x7 bytes C libhttpd.dll!6ff01575() [Frames below may be incorrect and/or missing, no symbols loaded for libhttpd.dll] libhttpd.dll!6ff019fd() libhttpd.dll!6ff0e15c() libhttpd.dll!6ff09966() libhttpd.dll!6ff04275() libhttpd.dll!6ff044f2() libhttpd.dll!6ff1c3b8() msvcr71.dll!7c36b381() ntdll.dll!7c91849f() msvcr71.dll!7c3638e2() kernel32.dll!7c80b683() ntdll.dll!7c91849f()