BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Re: Lock record / D7 and SQL2000

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (SQL Servers)
View previous topic :: View next topic  
Author Message
Robert Brock
Guest





PostPosted: Mon Aug 09, 2004 5:48 pm    Post subject: Re: Lock record / D7 and SQL2000 Reply with quote



SQL is a shift from desktop databases, they use Optimistic as opposed to
Pessimistic locking, in other words, most SQL applications expect to handle
the problem AFTER they try to save..

From the old BDE, this was represented with UpdateKind..
UpWhereAll - Update would succeed if NONE of the Columns listed were changed
since grabbed.
UpWhereChanged - Update would succeed if NONE of the CHANGED Columns were
changed..
UpWhereKeyOnly - Update would succeed as long as the primary key hadn't
changed..
After a failure, "Um, User A, another user beat you to it, so we have to
abandon your changes!"

You can use semaphore locks, ie, roll your own, by tracking who has what in
a table system that you construct and maintain..

The most reliable way to implement pessimistic locking is to update the row
FIRST with a dummy statement (set a value to itself), prior to edit state,
which effectively locks the row until next commit or rollback. This affects
concurrency, however, as with the user that opens an edit screen, and heads
off to a 3 hour lunch..

Rob


Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (SQL Servers) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.