|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-11-29 17:58 UTC] sixd@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 10:00:01 2025 UTC |
Description: ------------ PHP 5.2.3 / 5.2.4 / 5.2.5 Apache 2.2.6 Oracle-DB 10.2.0.3.0 Oracle-Client 10.2.0.3 OS Linux Usually, when leaving a function, php closes e.g. statements implicitly. This works as long as a lob is selected. When a lob is selected, i have to call oci_free_statement() explicitly on the statement, otherwise the cursor is kept open and i have a dangling cursor. This issue can cause an "ORA-01000: maximum open cursors exceeded". Our db setting for open_cursors is 300, so every session is allowed to have max 300 cursors open simultaneously. if i run the reproduce code below, i get an ORA-01000 create the following table: create table t_lobdata ( id number not null, data clob ); fill table: insert into t_lobdata select rownum, object_name from sys.all_objects; Reproduce code: --------------- <?php $conn = ocilogon('user', 'pass', 'db'); function getLob($conn, $id) { $result = null; $stmt = ociparse($conn, 'select id, data from t_lobdata where id = :id'); ocibindbyname($stmt, ':id', $id, -1); ociexecute($stmt, OCI_DEFAULT); ocifetchinto($stmt, $result, OCI_ASSOC+OCI_RETURN_LOBS); return $result; } for ($id = 1; $id <= 300; $id++) { $result = getLob($conn, $id); } ?> Expected result: ---------------- cursor gets closed implicitly when leaving the function Actual result: -------------- cursor isn't closed, which results in dangling cursors and an ORA-01000