Re: Recover After Crash

From: Carl Rosenberger <carl_at_db4o.com>
Date: Wed, 13 Sep 2000 20:50:47 +0200
Message-ID: <8poia8$6lk$17$1_at_news.t-online.com>


[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.com
Received on Wed Sep 13 2000 - 20:50:47 CEST

Original text of this message