Board index » delphi » Lock or Unlock a record?

Lock or Unlock a record?

I want to lock a record when a user editing it . and unlock it after apply
or cancel the modified.  how to ?

**********************
best regards.

 

Re:Lock or Unlock a record?


Quote
xlr wrote:

> I want to lock a record when a user editing it . and unlock it after apply
> or cancel the modified.  how to ?

        My advice would be don't.  IB has better mechanisms for resolving
conflicts between users, and locking records quickly becomes a
bottleneck in a heavily multi-user environment.  Consider what happens
when a user starts editing a record and then goes to lunch.  Now imagine
500 users all doing the same thing.

        Instead you can handle deadlocks and other conflicts on the rare times
when they happen with grace: allow the user to see their data and the
other user's data and choose which is correct.

        -Craig

--
 Craig Stuntz (TeamB) Vertex Systems Corp. Columbus, OH
We're hiring: http://www.vertexsoftware.com/careerops.htm#sd
     Delphi/InterBase WebLog: http://delphi.weblogs.com

Other Threads