Re: row edited by more than one user at same time
From: Brian Bushay TeamB (BBushay_at_Nmpls.com)
Date: 05/13/04
- Next message: Brian Bushay TeamB: "Re: Transaction problem"
- Previous message: William Wong: "Re: 7.1 Update ruined my computer"
- In reply to: Vojta Nadvornik: "row edited by more than one user at same time"
- Next in thread: Vojta Nadvornik: "Re: row edited by more than one user at same time"
- Reply: Vojta Nadvornik: "Re: row edited by more than one user at same time"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 12 May 2004 22:51:51 -0500
>What is the easiest and "cleanest" way to solve problem of two users trying
>edit the same record.
>When I try to do this the second user gets error "row changed while
>updating" or sthing like this.
What you are experiencing is the SQL server default of Optimistic locking.
With optimistic locking the record is locked only when it is being posted.
Depending on how the ADO Update Criteria property is set the error you are
getting may be triggered when another user has changed the record when you go to
post it.
If you simply want to always post the record with no warning that it has changes
set the Update Criteria to adCriteriaKey.
Or if you initial post fails because another user has changed it check if the
user wants to over write the record and then change the update Criteria
>I have some ideas:
>1. Some kind of locking the row
SQL server does pessimistic locking but not as easily as pessimistic locking and
only if you use server side cursors which will affect the saleability of SQL
server
>2. Time stamps (additional field where is stored some information from that
>you can get the post rights)
I don't see how this would help.
>3. stored procedure that will handle the updating
More complicated than just changing the UpdateCriteria.
>4. handle isolation levels (know nothing much about it)
Not something you want to do during a user edit.
>Which approach is used most? Which is the "best"?
>
>The result should be that no user will be working on data that won't be able
>to post.
>
>The problem is generic but I am interested especially in MS SQL Server
>solution.
-- Brian Bushay (TeamB) Bbushay@NMPLS.com
- Next message: Brian Bushay TeamB: "Re: Transaction problem"
- Previous message: William Wong: "Re: 7.1 Update ruined my computer"
- In reply to: Vojta Nadvornik: "row edited by more than one user at same time"
- Next in thread: Vojta Nadvornik: "Re: row edited by more than one user at same time"
- Reply: Vojta Nadvornik: "Re: row edited by more than one user at same time"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|