Re: Cursor locking

From: Peter Mckenzie <Peter.McKenzie_at_health.wa.gov.au>
Date: Thu, 25 Mar 1999 16:56:25 GMT
Message-ID: <7ddprj$n2j$1_at_nnrp1.dejanews.com>


>
> Open a cursor for update, and the records are locked.
>
> Unlock them with commit or rollback (and nothing else), after which you may
> not fetch (ORA-01002 fetch out of sequence) from that cursor anymore (unless
> it's closed and then opened again). Hence, you might as well close it before
> commit/rollback, just to keep your code tidy.
>
> Regards,
>
> Roy Brokvam
> roy.brokvam_at_conax.com
>
>

[Quoted] Somewhere in Feuerstein's ORACLE PL/SQL book he says close your cursor to release locks. Elsewhere he says Commit or Rollback. This is what started me thinking. A programmer might open a cursor for update but make no updates as a result of some logic within his 'for' loop. He might think that because no updates where made no commit is required and just close the cursor. I would have hoped that provided no updates were made the cursor close would do the trick - but according to you the commit is always required.

-----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own Received on Thu Mar 25 1999 - 17:56:25 CET

Original text of this message