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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
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

Add a Patch

Pull Requests

Add a Pull Request

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-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 17:01:30 2024 UTC