Open cursor problem

jhui

Member
At a customers site we have to deal with OPEN_CURSORS = 50

In our MIDAS server's datamodule we have quite a lot of TOracleDataSets and a few TOracleQueries. All of these, when opened or executed, take up a lot of cursors. On most occasions we eventually run out of them.

Of course, one way to go is to increase the OPEN_CURSORS parameter.

But when I ran the query

select * from v$open_cursor

I saw a lot of cursors that, on my account, needed not to be there.
To try and decrease the number of cursors I did the following:

1] call ToracleDataSet.CloseAll in the AfterClose event of each TOracleDataSet and also manually/recursively close all connected details datasets. These were not automatically closed !

2] call Close after each TOracleQuery.Execute to release resources.

3] There were also a lot of open cursors for querying constraints in the Oracle dictionary. In the source I saw this was done through TOracleTableInfo.Query and the TOracleDataSet.DMLQuery. These queries were never closed. So I closed them.

After these modifications, I brought the # of cursors down to 10, where it first was more than 50.

Now I have one question:

Can I close the queries in item 3] without any problems ? It seems to work alright.
Please advise.

TIA

Jan Huizinga.
 
You can close them without any problem. You will only generate more open/close cursor operations, so performance may decrease somewhat. It is always advisable to increase the OPEN_CURSORS limit, if possible.

------------------
Marco Kalter
Allround Automations
 
Back
Top