Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: Recover After Crash
[Locking under Oracle crashsafe]
> update DOCUMENT set STATUS=1 where DOC_ID=xxx
> - to lock xxx document
A possible solution (pseudocode):
Statement = "select DOC_ID from DOCUMENT where DOC_ID = xxx for update
nowait"
Declare Cursor
Prepare Cursor from Statement using Transaction
Open Cursor
Fetch Cursor
Close Cursor
The record should be locked until the Transaction commits, rollbacks or disconnects.
The Fetch Cursor sqlcode result shows you, if the row is already locked.
HTH
Regards,
Carl
-- Carl Rosenberger db4o - database for objects - http://www.db4o.comReceived on Wed Sep 13 2000 - 13:50:47 CDT
![]() |
![]() |