Dear oh deary me, this is sooo 1970s!
Guys, Google 'optimistic locking' 

[Quick overview:
 1) When the user first looks at the data, 
    * read the record, no lock, 
    * save a copy in memory (Named Common) or on a BeforeLook disk file
 2) When the user wants to update the record,
    * read the record with lock
    * compare the just-read record with the saved copy
      + if they are the same 
        - write the updates
      + if they are different
        - give the user an error message
          "someone else fritzed with it while you were dawdling"
    * throw away the BeforeLook
    * unlock everything, you're done
 This is called 'optimistic' because you're betting that the BeforeLook 
 and the current record are almost always the same, so you hardly ever 
 get to take the error path.
End of quick and probably oversimplified overview]


-----Original Message-----
> From: u2-users-boun...@listserver.u2ug.org On Behalf Of Mecki
Foerthmann
> Sent: Thursday, 2 September 2010 5:00 a.m.
> To: U2 Users List
> Subject: Re: [U2] [UV] Shared Record Locks
> 
> 
>  Bill,
> 
> I thought doing something similar myself when I was a Junior
programmer
> because some people tend to lock records and go for lunch etc..
> But what happens if you read the record into the variable R.This do
some
> processing, then the phone rings and you talk for 10 minutes, while
> somebody else uses the same process, changes the record and writes it
> 
[snip]
The information contained in this Internet Email message is intended
for the addressee only and may contain privileged information, but not
necessarily the official views or opinions of the New Zealand Defence Force.
If you are not the intended recipient you must not use, disclose, copy or 
distribute this message or the information in it.

If you have received this message in error, please Email or telephone
the sender immediately.
_______________________________________________
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users

Reply via email to