php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #12518 ocifreestatment doesn't free the Oracle cursor and so you run out of cursors
Submitted: 2001-08-01 13:20 UTC Modified: 2001-08-06 13:24 UTC
From: derek at innovyx dot com Assigned:
Status: Not a bug Package: OCI8 related
PHP Version: 4.0.6 OS: Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: derek at innovyx dot com
New email:
PHP Version: OS:

 

 [2001-08-01 13:20 UTC] derek at innovyx dot com
the ocifreestatment function doesn't actually free the Oracle cursor, these are only freed when the script exits.

While this isn't a problem when using PHP as a web page it is a problem if you have a command line script that has to perform thousands (or tens of thousands) of queries eventually the open_cursors limit is exceeded and all further queries fail.

The same appears to be true with connections.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-08-01 16:18 UTC] thies@php.net
what makes you belive it doesn't work?

please send me a short testcase that shows leakage of 
resources.



 [2001-08-06 12:59 UTC] derek at innovyx dot com
I have a long-running PHP script that eventually comes up with: 

Failed execution, error: ORA-00604: error occurred at recursive SQL level 2 ORA-01000: maximum open cursors exceeded.

I don't explicitly use any cursors in this script btw. In addition I found (via a web search) that someone else has been experiencing the same thing.

However, in response to your request I've been trying to build a test script to leak cursors and reproduce the problem, unfortunately, thus far, even deliberately leaking cursors is not producing it. :(

 [2001-08-06 13:23 UTC] derek at innovyx dot com
With the help of v$open_cursor I've tracked down the problem and it was a case of user error, my apologies for having taken up your time.

 [2001-08-06 13:24 UTC] sniper@php.net
user error
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Jul 02 03:01:35 2025 UTC