Print Thread
FAQ: ORA-01000: maximum open cursors exceeded
#25 09/04/99 07:40 PM
Joined: Sep 1999
Posts: 21
F
faq Offline OP
Member
OP Offline
Member
F
Joined: Sep 1999
Posts: 21
After running my application for a while, I get an ORA-01000 error. How can I avoid this?

Re: FAQ: ORA-01000: maximum open cursors exceeded
#26 09/04/99 07:41 PM
Joined: Sep 1999
Posts: 22
S
Administrator
Offline
Administrator
S
Joined: Sep 1999
Posts: 22
The ORA-01000 error is a very common problem. Every TOracleQuery, TOracleDataSet and TOraclePackage component linked to the same TOracleSession takes up one or more cursors from this session. The OPEN_CURSORS limit is a limit per session, not a transaction limit or system wide limit.

The default OPEN_CURSORS limit of 50 is too little for any major application, and should normally be increased to a value that is sufficient for your application. Increasing this parameter has no negative side effects, and makes better use of resources than the alternative: closing and opening cursors all the time for the same query.

To determine the value of the OPEN_CURSORS parameter that is sufficient for your application, you can make the following estimation:

OPEN_CURSORS = q + p + (2 * d)

Where q = the number of TOracleQuery components, p = the number of TOraclePackage components, and d = the number of TOracleDataSet components. This value will probably be more then is necessary in practice, because not
all queries and datasets will be "open" at the same time.

The ORA-01000 problem can also occur if you are creating and executing one of the components mentioned above without freeing it. The instance will remain in memory, and the corresponding database cursor will remain open.

For some applications it may be required that they can work with the default value of the OPEN_CURSORS initialization parameter. In that case you need to explicitly close TOracleQuery components after executing it and fetching the results. For TOracleDataSet components, calling Close does not free up both cursors. The cursor for the dataset's select statement remains open so that it can be immediately re-executed when the dataset is opened again. Call the CloseAll procedure to close all cursors.


Moderated by  support 

Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.4
(Release build 20200307)
Responsive Width:

PHP: 7.1.33 Page Time: 0.033s Queries: 14 (0.010s) Memory: 2.4964 MB (Peak: 3.0378 MB) Data Comp: Off Server Time: 2024-04-19 16:26:46 UTC
Valid HTML 5 and Valid CSS