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: Handling multiple users

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





PostPosted: Mon Sep 15, 2003 5:41 pm    Post subject: Re: Handling multiple users Reply with quote



Use a trigger to do validation or a stored procedure to do validation and
update.

--
Robert Cerny
DelphiShaman
"Kris" <noreply (AT) nomail (DOT) com> wrote

Quote:
Suppose I have a multiuser app accessing a SQLServer database, and when a
user want to update some data, certain condition A must be valid (for
example, some query must return no records).

Suppose condition A is valid:

Query.Open;
if Query.RecordCount = 0 then <<-- A is Valid
begin
// Let the user update the database
SomeTable.Edit;
...........
SomeTable.Post; /// <<-- After post is executed, A is no longer valid
end;

Now: suppose that after RecordCount = 0 is checked, and just before the
.Post, A is no longer valid because another user made modifications to the
DB: then the app will be in an invalid state.

How to solve this problem? With transactions? Locking exclusibly the table
where Query consults?
Thanks







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.