Subject | Re: [IBO] Re: More on record locking |
---|---|
Author | Jason Wharton |
Post date | 2000-12-16T00:43:43Z |
Bob,
and the user needs to do their whole transaction another time.
PessimisticLocking is just extra work that is usually unnecessary.
One thing you had to recall is that there were no such things as
transactions with file based databases. As a result you had to be careful
about how changes were applied so that each user's work was done as one
atomic unit. This is all built into the engine now so you don't have to
worry about it anymore. Just let all users do whatever and if something goes
wrong you rollback the whole thing and start over again. Sounds harsh but
functionally it is just much cleaner to work that way even from an end-users
point of view. If it is a long process the user goes through then of course
it should be broken up into various stages but with transactions there
really is no need to be concerned with locks.
cannot go into edit mode on the same record. Optimistic means you let users
go into edit mode and are "optimistic" that another user isn't doing the
same thing.
Jason Wharton
CPS - Mesa AZ
http://www.ibobjects.com
> Thanks for your reply Jason. The PessimisticLocking parameter doesI don't use pessimistic locking. If there is a conflict there is a conflict
> the trick.
>
> Is this the method you use in a true client server application? Or is
> there a better way?
and the user needs to do their whole transaction another time.
PessimisticLocking is just extra work that is usually unnecessary.
One thing you had to recall is that there were no such things as
transactions with file based databases. As a result you had to be careful
about how changes were applied so that each user's work was done as one
atomic unit. This is all built into the engine now so you don't have to
worry about it anymore. Just let all users do whatever and if something goes
wrong you rollback the whole thing and start over again. Sounds harsh but
functionally it is just much cleaner to work that way even from an end-users
point of view. If it is a long process the user goes through then of course
it should be broken up into various stages but with transactions there
really is no need to be concerned with locks.
> And, what then is the difference between optimistic and pessimisticI think I pretty much already summed it up. Pessimistic means two users
> concurrency?
cannot go into edit mode on the same record. Optimistic means you let users
go into edit mode and are "optimistic" that another user isn't doing the
same thing.
> One last question: In the BDE the user name was returned in theNo, unfortunately not.
> exception message if a record was being edited. Is this still
> available?
Jason Wharton
CPS - Mesa AZ
http://www.ibobjects.com