473,419 Members | 1,910 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,419 software developers and data experts.

How to enforce pessimistic record locking?

I have been ok with optimistic locking most of the time but I have a
situation now where there is more of a chance that users could try to
edit a record at the same time. I'd like to use pessimitic locking, but
it's not working quite as I expected. I've read all over, and by now
have posted elsewhere on this subject, and (strangely it would seem)
have made no progress. This seems to be a bit of a blank spot on the
map. (Access 2000-2003, dao)

With the form's Record Locks property set to Edited Record, if I leave
the form's record selector visible, a second concurrent user's attempt
to edit a record is immediatly flagged with the "no" (or locked) symbol.
But I don't use record selectors, and the symbol isn't very informative
for end users. I want user one to be able to start editing a record; and
if user 2 attempts to do so, be prevented from starting. How can I
detect that this record is not available for edits, and notify the user
in some manner?

The common suggestion is to turn on pessimistic locking, open a
recordset pointing to the same record, and use the .Edit method on it,
trapping the error that should arise if it's already being edited. Fine,
that works, but even with all files on one pc, it takes two seconds for
the error to be raised (why?), which is far too long.

Another supposed option that gets some mention is the dao recordset
property .EditMode but I've never been able to get it to return any
value other than 0, regardless of the acutal state of the record. So
it's not of any real use.

Finally the record selector's "locked" status flag does not seem to be
exposed as an event etc.

All of the roadblocks I've encountered and have related above have been
voiced by others in newsgroups over the years. But I've not seen a
solution. Kind of hard to believe! I'd prefer to use some native Access
mechanism for this, but if it's that busted, does anyone have a
workaround routine for this that they'd be willing to share?
Nov 26 '05 #1
1 4831
No one has anything on this? It really seems to be a bit off the beaten
track, but that's surprising in itself.

In article <MP************************@newsgroups.comcast.net >,
wh***@wheel.not says...
I have been ok with optimistic locking most of the time but I have a
situation now where there is more of a chance that users could try to
edit a record at the same time. I'd like to use pessimitic locking, but
it's not working quite as I expected. I've read all over, and by now
have posted elsewhere on this subject, and (strangely it would seem)
have made no progress. This seems to be a bit of a blank spot on the
map. (Access 2000-2003, dao)

With the form's Record Locks property set to Edited Record, if I leave
the form's record selector visible, a second concurrent user's attempt
to edit a record is immediatly flagged with the "no" (or locked) symbol.
But I don't use record selectors, and the symbol isn't very informative
for end users. I want user one to be able to start editing a record; and
if user 2 attempts to do so, be prevented from starting. How can I
detect that this record is not available for edits, and notify the user
in some manner?

The common suggestion is to turn on pessimistic locking, open a
recordset pointing to the same record, and use the .Edit method on it,
trapping the error that should arise if it's already being edited. Fine,
that works, but even with all files on one pc, it takes two seconds for
the error to be raised (why?), which is far too long.

Another supposed option that gets some mention is the dao recordset
property .EditMode but I've never been able to get it to return any
value other than 0, regardless of the acutal state of the record. So
it's not of any real use.

Finally the record selector's "locked" status flag does not seem to be
exposed as an event etc.

All of the roadblocks I've encountered and have related above have been
voiced by others in newsgroups over the years. But I've not seen a
solution. Kind of hard to believe! I'd prefer to use some native Access
mechanism for this, but if it's that busted, does anyone have a
workaround routine for this that they'd be willing to share?

Nov 28 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Fardude | last post by:
ACCESS 97, Pessimistic Record Locking!??? Does Access 97 allow record level Pessimistic locking? In other words, when user A is editing a record (has it locked) and User B tries to edit it...
0
by: ethanj /personal/ | last post by:
We are using Access 2000 database, with the following settings. Tool > Options > Advance > Default Record Locking = Edited Record Open databases using record level locking = True Form...
2
by: Patrick Fisher | last post by:
Hi To display a message when a user attempts to edit a record in a multi-user environment where a forms Record Locking is set to Edited Record and another user is editing a record, is difficult...
22
by: RayPower | last post by:
I'm having problem with using DAO recordset to append record into a table and subsequent code to update other tables in a transaction. The MDB is Access 2000 with the latest service pack of JET 4....
9
by: master | last post by:
Actually, it is not only the record locking, what I need, and nobody seems to descibe this. Imagine the following scenario. There is a database with, say 10000 records with some unvalidated...
4
by: misterutterbag | last post by:
Hi. Given the following: ---------------- String lockSubscriptionQuery = "SELECT subscriptionId FROM subscription WHERE subscriptionId = ? FOR UPDATE"; pStmt =...
1
by: DaveP | last post by:
How do i do Pessimistic locking in ado.net with c# Thanks DaveP
0
by: Cindy Huyser | last post by:
I have an Access 2000 database behind a threaded Java application that that can have have concurrent access to the same table (but not the same record). The database is set up for shared access...
1
by: Paul H | last post by:
I have an Employees table with the following fields: EmployeeID SupervisorID Fred Bob Bob John Bob Mary Bill Bill I have created a self join in...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.