Recover After Crash

From: Michael Kluev <kluev_at_stalker.gamma.-deIete-.ru>
Date: Wed, 13 Sep 2000 22:26:29 +0400
Message-ID: <kluev-1309002226290001_at_node9.stalker.gamma.ru>


Hi, I have the following question about recovering after crash.

The system that we design works with Oracle database. Each "document" that user see is a line in the table 'DOCUMENT'. 'DOCUMENT' table contains the following fields:

NAME DESCRIPTION STATUS CONTENTS more fields

When user opens "document" one field of that table (STATUS) is set to 1, when user closes document it is set back to 0.

update DOCUMENT set STATUS=1 where DOC_ID=xxx - to lock xxx document update DOCUMENT set STATUS=0 where DOC_ID=xxx - to unlock xxx document

When someone wants to open "document" the STATUS field is checked, and if status is 1 the open attempt is rejected. So far so good.

The problem occurres on crash case: crash of program, crash of workstation, crash of server, network mulfunction, etc. The problem is that document remains locked (with STATUS 1) when no one longer uses it. It remains locked forever until we manually unlock it. We want such "crashed" documents to be unlocked automatically. If this is not possible, we want to test whether current "holder" (SESSION ID? Whatever) of document is still active when testing document status. This test should pass within minutes (if not seconds) after crash case occured, so user will be able to open and work with "crashed" document within minutes (if not seconds) after crash.

Is there a way to solve this problem? At server side? At client side? Any suggestions, comments are appreciated.

Please both post and e-mail your answer to kluev_at_stalker.gamma.ru

-- 
Michael Kluev.

PS. Remove "-delete-." part from my address to reply.
Received on Wed Sep 13 2000 - 20:26:29 CEST

Original text of this message