Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Is is necessary to rollback after each select to release open cursors?

Re: Is is necessary to rollback after each select to release open cursors?

From: Jim Kennedy <kennedy-downwithspammersfamily_at_attbi.net>
Date: Thu, 11 Dec 2003 15:31:11 GMT
Message-ID: <350Cb.363584$ao4.1225448@attbi_s51>

"philb" <philb_at_tei-on.com> wrote in message news:7b09fb80.0312110725.338e9452_at_posting.google.com...
> Is is necessary to rollback after each select to release open cursors
> in Oracle? I've been seeing "too many open cursors" errors after doing
> selects and thought that the select may have left the cursor open?
> Does this happen or are they automatically tidied up by Oracle? Do I
> need to rollback to close them, and is rollback the best way of doing
> that?
>
> BTW I'm using OCI on Oracle 9.2 and am the only user accessing the
> table at the time.
>
> Apologies if this is an obvious question, but I can't find a an answer
> in the books I have, or on Google groups.
>
> thanks, philb

You need to close the cursor or reuse it. You are allocating it and not closing it or reusing it; you keep allocating cursors. The most efficient thing is to allocate a cursor once (with bind variables) and reuse it so you avoid repeated parsing. (see Oracle Application Developer's guide) Jim Received on Thu Dec 11 2003 - 09:31:11 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US