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

Home -> Community -> Usenet -> c.d.o.tools -> Re: Recover After Crash

Re: Recover After Crash

From: Carl Rosenberger <carl_at_db4o.com>
Date: Wed, 13 Sep 2000 23:51:36 +0200
Message-ID: <8postb$cvc$13$1@news.t-online.com>

> > [Locking under Oracle crashsafe]

>> "select DOC_ID from DOCUMENT where DOC_ID = xxx for >> update nowait"  

> This means that transaction should be opened for the whole
> period when user works with document - it could be hours.

Where is the problem?

> I guess, this is not "good thing" to have transaction opened
> for so long. If I will modify other tables/rows of this table
> (while having transaction is opened), will my modifications
> be seen by elsewhom? I think not - this is not appropriate.

This depends on the isolation level you are using. "Read Committed" is what you should be using. In this case only committed data is seen by other people.

There is some good information on isolation levels in the Oracle documentation. Search for "phantom".

If you consider an open transaction a bad idea:

- Let the user insert a dataset into a timestamp table on the server.
- Select Sequence.currval to get the pkey of this dataset.
- Use this pkey to identify the lock on DOCUMENT
- Write some "High I am still there" information back to the server in
whatever time interval.
- Some Check-Code clears Dead-Locks.
- Store your "HiThere-ID" locally, so you can reuse it, so you don't wait upon your own lock upon a crash.

You can also use Oracles proprietary Connection-ID but I am sorry not to have this at hand.

HTH. Regards,
Carl

--
Carl Rosenberger
db4o - database for objects - http://www.db4o.com
Received on Wed Sep 13 2000 - 16:51:36 CDT

Original text of this message

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