|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-11-24 10:01 UTC] tony2001 at phpclub dot net
[2005-11-24 10:29 UTC] sgattas at fibertel dot com dot ar
[2005-11-24 10:40 UTC] tony2001 at phpclub dot net
[2005-11-24 14:32 UTC] sgattas at fibertel dot com dot ar
[2005-11-24 14:38 UTC] tony2001 at phpclub dot net
[2005-11-24 15:32 UTC] sgattas at fibertel dot com dot ar
[2005-11-24 15:36 UTC] tony2001 at phpclub dot net
[2005-11-25 05:20 UTC] tony2001 at phpclub dot net
[2005-11-25 15:23 UTC] sgattas at fibertel dot com dot ar
[2005-11-28 19:13 UTC] sgattas at fibertel dot com dot ar
[2005-11-28 19:14 UTC] sgattas at fibertel dot com dot ar
[2005-12-01 10:07 UTC] tony2001 at phpclub dot net
[2005-12-01 10:32 UTC] sgattas at fibertel dot com dot ar
[2005-12-01 10:45 UTC] tony2001 at phpclub dot net
[2005-12-02 07:20 UTC] tony2001 at phpclub dot net
[2005-12-13 10:08 UTC] sgattas at fibertel dot com dot ar
[2006-03-21 10:30 UTC] tony2001 at phpclub dot net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Nov 06 22:00:01 2025 UTC |
Description: ------------ Related to php bug_id: 31693. On that thread, it was suggested to use the pecl version of php_oci8.dll to fix the issue with ref cursors. We installed it (PHP Version (branch): php-5.0.5 (5_0), Last build: 2005-11-08 15:11:43), made no modifications in the php.ini but when we tested it it starts adding new conections and not closing the inactive ones. So out database, when reaching more than 800 inactive conns, starts suffering. So, we added the following in the php.ini: oci8.persistent_timeout = 900 Restarted and after it, we don't see new conections but the process is giving the invalid cursor error again. Reproduce code: --------------- <? session_start(); set_time_limit(0); $con1=OCILogon("XXX", "XXX" ,"XXX") ; if ( ! $con1 ) { $arrError = OCIError(); $msg='There is an error on the database side and SMD is not able to connect. Please, inform your DBA about the following error: '.$arrError['message']; echo $msg; } unset($_SESSION['data']); $df = "ALTER SESSION SET NLS_DATE_FORMAT = 'DD/MM/YYYY'"; $a=OCIParse($con1, $df); OCIExecute($a); $as = "ALTER SESSION SET NLS_NUMERIC_CHARACTERS = '.,'"; $b=OCIParse($con1, $as); OCIExecute($b); $out=OCINewCursor($con1); $s=OCIParse($con1, "begin rels_6.prc_rel1_daily(:b1,:b2,:b3,:b4,:b5,:b6,to_date(:b7,'dd/mm/yyyy'),to_date(:b8,'dd/mm/yyyy'),:b9); end;"); OCIBindByName($s, ":b1", &$uf,-1); OCIBindByName($s, ":b2", &$site,-1); OCIBindByName($s, ":b3", &$acc,-1); OCIBindByName($s, ":b4", &$ope,-1); OCIBindByName($s, ":b5", &$equ,-1); OCIBindByName($s, ":b6", &$ate,-1); OCIBindByName($s, ":b7", &$from,-1); OCIBindByName($s, ":b8", &$to,-1); OCIBindByName($s, ":b9", $out,-1, OCI_B_CURSOR); OCIExecute($s, OCI_DEFAULT); OCIExecute($out); $_SESSION['data'] = array(); $_SESSION['data'][0][1]='V1'; $_SESSION['data'][0][2]='V2'; $_SESSION['data'][0][3]='V3'; $_SESSION['data'][0][4]='V4'; $_SESSION['data'][0][5]='V5'; $_SESSION['data'][0][6]='V6'; $_SESSION['data'][0][7]='V7'; $_SESSION['data'][0][8]='V8'; $_SESSION['data'][0][9]= $_POST['cname']; $_SESSION['data'][0][10]='V9'; $_SESSION['data'][0][11]='V10'; $_SESSION['data'][0][12]='V11'; $_SESSION['data'][0][13]='V12'; $_SESSION['data'][0][14]='V13'; $_SESSION['data'][0][15]='V14'; $_SESSION['data'][0][16]='V15'; $_SESSION['data'][0][17]='V16'; while (OCIFetchInto($out,&$data)) { for ($n=0; $n<18 ; $n++) { if ($_POST['qfiltro']==$n) { if ($data[6]==1 && $data[7]==1) {$_SESSION['data'][$ii][9]='Totais';} else {$_SESSION['data'][$ii][9]=$data[$n];} } if ($n>=9) { switch ($n) { case 12: $valor=number_format((($data[11]+$data[10])/$data[9])*100,1,',','.'); break; case 15: $valor=number_format((($data[14]+$data[13])/$data[9])*100,1,',','.'); break; case 16: $valor=number_format((($data[11]+$data[10]+$data[12]+$data[13])/$data[9])*100,1,',','.'); break; default: $valor=$data[$n]; break; } if ($n==12 or $n==15 or $n==16) {$_SESSION['data'][$ii][$n+1]=$valor;} else { $_SESSION['data'][$ii][$n+1]=TimeFormatting($valor); } } } $ii++; } OCIFreeCursor($s); OCIFreeStatement($out); OCILogOff($con1); ?> Expected result: ---------------- Expected result: both queries returning all rows. Actual result: -------------- [24-Nov-2005 11:51:32] PHP Warning: ocifetchinto() [<a href='function.ocifetchinto'>function.ocifetchinto</a>]: OCIFetchInto: ORA-01001: invalid cursor in E:\...\...\...\php\smd_rel1_proc.php on line 59 When you submit the same query from two different sessions, the first one gets the error and the second one -the one that "steals" the first session conn- finishes succesfully. The first onw gets the error described up supra.