Re: Strange multi-user timing phenomenon
- From: mscertified <rupert@xxxxxxxxxxxxx>
- Date: Thu, 3 Apr 2008 18:05:00 -0700
Thanks for the response.
I've posted questions related to this for about a week and have not had much
feedback so far.
The essential problem is in a multi-user system to alllow different users to
grab records (read then eventually delete) from a table whilst ensuring no
two users EVER get the same record.
My locking mechanism is to insert a record to a special table whose only
purpose is to force single-threading. I insert a single record with a single
primary key. I delete this record at the end of processing. If the insert
fails I wait for .5 seconds and try again up to a max of 6 tries then display
a message.
This is my 4th attempt to get this to work - all previous attempts having
failed as well. However, I think I'm getting closer...
"Paul Shapiro" wrote:
Look at how you're "locking", because as you say, it's not locking what you.
think it is. If your lock was exclusive and was working, then user 2 would
indeed not be able to place the "impossible" lock. If you want help you have
to give us a little more info. What are you locking and how are you locking
it?
"mscertified" <rupert@xxxxxxxxxxxxx> wrote in message
news:646353B4-4FFF-4FEA-B33E-53C42D37324E@xxxxxxxxxxxxxxxx
Problem: 2 users appear able to insert the same (unique) primary key to
the
same table.
I'm attempting to enforce single-threading of a process by inserting a
record to a table. All users use the same primary key so only one
(theoretically) can succeed. Other users go into a wait and retry loop.
After
processing, I delete the record thus releasing the lock. I've traced the
processing for 2 users (using timer function). The processing sequence is:
user 1 places lock
user 2 lock fails
user 1 processes record
user 2 places lock (should be impossible!)
user 2 processes record
user 1 releases lock
user 2 releases lock
A couple of questions?
Can the timer function be compared between 2 different users?
I'm assuming that inserted and deleted rows are inserted and deleted
immediately and immediately visible to other users, is this the case?
- Follow-Ups:
- Re: Strange multi-user timing phenomenon
- From: Paul Shapiro
- Re: Strange multi-user timing phenomenon
- References:
- Strange multi-user timing phenomenon
- From: mscertified
- Re: Strange multi-user timing phenomenon
- From: Paul Shapiro
- Strange multi-user timing phenomenon
- Prev by Date: Re: Accessing data from a subform in the parent form's recordset
- Next by Date: Re: I am stumped....TimeValue problem
- Previous by thread: Re: Strange multi-user timing phenomenon
- Next by thread: Re: Strange multi-user timing phenomenon
- Index(es):
Relevant Pages
|