dbTalk Databases Forums  

lock?

comp.databases.oracle comp.databases.oracle


Discuss lock? in the comp.databases.oracle forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Peter K
 
Posts: n/a

Default lock? - 11-14-2007 , 02:44 AM






Hi

I am writing a program (in c#) which provides functions for "document
handling". Each document is represented by a row in an Oracle database
table, and I need some way to "lock" this row if a user is editing the
document. (Database/sql is not my strong side, but I need to come up with
some sort of mechanism for this).

By "locking" I mean that I have some means to say "this document is being
edited by a user and no other user can/should edit it".

How can I make such a lock? I was thinking of a column called "lock" which
I could set to the user's id if they were editing the document - but then I
don't know how to ensure that only one user could attempt to obtain the
lock at a time if, for example, two users simultaneously asked for the
lock.

Any hints are very welcome!

Thanks,
Peter

Reply With Quote
  #2  
Old   
Ana C. Dent
 
Posts: n/a

Default Re: lock? - 11-14-2007 , 09:46 AM






Peter K <xdzgor (AT) hotmail (DOT) com> wrote in
news:473ab56d$0$15889$edfadb0f (AT) dtext01 (DOT) news.tele.dk:

Quote:
Hi

I am writing a program (in c#) which provides functions for "document
handling". Each document is represented by a row in an Oracle database
table, and I need some way to "lock" this row if a user is editing the
document. (Database/sql is not my strong side, but I need to come up
with some sort of mechanism for this).

By "locking" I mean that I have some means to say "this document is
being edited by a user and no other user can/should edit it".

How can I make such a lock? I was thinking of a column called "lock"
which I could set to the user's id if they were editing the document -
but then I don't know how to ensure that only one user could attempt
to obtain the lock at a time if, for example, two users simultaneously
asked for the lock.

Any hints are very welcome!

Thanks,
Peter

SELECT ........... FOR UPDATE


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.