
Jet 3.5 Pessimistic Locking
Quote:
>The only times I have seen programs where a user can bring up a record,
walk away and
>lock all other users out are cases where PC bred programmers who grew up
owning the
>entire machine were thrust into multi user apps and either not given
directions or
>not thinking about concurrency issues.
I think it's important to realize the other side of the coin as well...
While pessimistic locking does truly "take over" the record from possible
edit by all users, there are some occasions where this is desirable. For
example, you may have an app with a form that has several tabs on a tab
control. Each tab may have 5 or 10 fields, and some require lengthy
"memo-text" entry or thought-provoking choices. The typical user might
spend 5 or 10 minutes entering the data for this type of record.
At my last job, we actually *desired* to truly lock the record while editing
because we didn't want one user to spend 5 or 10 minutes setting up an
employee record (on a complex form as described above), only to hit OK to
save his record and find out someone else had just updated (or created in
the case of a new record) the record in the meantime, and his screenful of
data was now stale and he had to lose his changes so he could re-acquire the
latest copy of the record.
Now, all this must be weighed against the liklihood of conflict over the
same record (depending on the number of users and the nature of the
application), as well as the complexity of the forms, and the user's ability
to deal with "losing" their changes if this should occur. Doing all of
this analysis is truly "thinking about concurrency issues", regardless of
which method is finally deemed most appropriate for the particular
application and user base.
I just think it should be pointed out that there are always two sides to
every coin, and choosing to lock a record pessimistically (during editing)
should not be globally categorized as "poor programming". Every
application, its usage, and its customer base is different. It's important
to view all those factors when deciding on an important architectural
paradigm such as how you want the application to respond in a multi-user
environment.
Vinnie Murdico
Software with Brains, Inc.
http://www.softwarewithbrains.com