General information
Title:
Multiuser Application problem
Hello Friends,
Please help me solve following situation in multiuser application.
I have a two date fields in one of my table in database.
Start date AND Stop Date.
Whenever I enter start date and stop date for new record. This start and stop should not overlap
with the dates of records which are already there in database.
for example, i have following entries in database.
start date stop date
06/14/99 06/20/99
06/22/99 06/25/99
now, for any new record , user can't enter start/stop date like 06/15/99 - 06/21/99 because it
overlaps the exsisting records.
That's why before saving any record, I check this validation by Select-sql on the database.This
works fine.
The problem is in multiuser situation. for example two users are entering new records at same time.
both have entered same start/stop date. let's say 06/27/99 - 06/30/99.
when User A goes to save this record, validation will check that is this range overlaps with any
previous records? He will not get any previous records with this range because User B has not
saved the changes yet. so He is allowed to save this record.
This is ok. but By the time User A gets the results of his query and he saves the record. User B saves the record.
so now, User A and User B both are allowed to save and database have duplicate entries.
I coudn't think what's the solution of this. I don't think I should user locking file mechanisam.
Please advise what's the solution of this situation.
Thanks in Advance
Thanks
Mark
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only