Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Implict Cursor Closure

Status
Not open for further replies.

Thargy

Technical User
Nov 15, 2005
1,348
GB
I am currently "doing battle" with a developer who sees no need to close cursors, once used.

I have googled and found the following article by the illustrious Mr Gennick. He cites conversation with Messrs. Feuerstein and Llewellyn w.r.t. closing cursors, and I would normally consider this definitive.

However, I note that the article dates from 2000. Since then a lot of water has flowed under the bridge, and I wonder if anyone can give me authoritative information about the closure (implicit or otherwise) of

Implicit, Explicit and/or ref cursors.

I'd like to be able to give an informed authoritative response to the rambunctious developer in question.

Regards

T
 
We have investigated by inspecting v$OPEN_CURSORS and matching SQL_TEXT with the VB recordset definition, and some further googling.

It appears that our developers should be more disciplined in their code, and explicitly close recordsets when they are finished with. They haven't always been doing this, so we are pushing for their coding standards to change to include explicit closure.

By closing a recordset, it does not force Oracle to immediately close the cursor, but allows it to do so. This means that oracle is at liberty to leave cursors available for possible subsequent sharing, and also at liberty to age 'mouldy oldies' out of memory.

At present, the upshot appears to be that provided developers are disciplined with closure statements in their code, open cursors are not a problem for oracle.

Regards

T
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top