PC Review


Reply
Thread Tools Rate Thread

Best way to deal with record-locking conflicts

 
 
Brian
Guest
Posts: n/a
 
      29th Dec 2009
Is there a best practice or are there design elements to use or avoid
regarding the interception and & processing of record-locking conflicts
during mass update processes?

I already trap error 7878 on forms where users may attempt to edit the same
record simultaneously, with two different users opening the same record
simultaneously. This is not a big problem because I can intercept the update
and notify the user of the conflict as the user is interacting with that
single record. However, when one user runs a query or SQL statement or opens
a recordset that will update many records, it is always possible that some
other user may have one of those records locked on a single-view form.

I can explain best by example: In my current project, I have (among many
others) a customer table and a route table. RouteID is the PK in the Route
table and an FK in the Customer table.

If one user has a particular customer record open via a bound (single) form
and another user attempts to do a mass move of customers, including that
customer, to a different route, it is fairly easy to deal with the user
having the single customer form open, but if the mass-update user experiences
the record-locking error, it will most likely occur in the middle of a query
affecting 150 records or, worse yet, after three or four steps of a process
involving dependent steps are completed, leaving some process half-done with
no way to determine the prior state of the individual records.

Is there, for example, a way to prequery and place a lock on all the records
to be included in a recordset or query?
 
Reply With Quote
 
 
 
 
Tom van Stiphout
Guest
Posts: n/a
 
      30th Dec 2009
Clifford already gave you the solution. And no, there definitely is no
way to pre-query for locks. Think about it: if that were possible, it
is also possible that the situation would have changed the millisecond
after you perform such query, so that information is not helpful.

As Clifford says: you process action queries (plural) in a
Transaction, and you handle whatever errors may be thrown.

-Tom.
Microsoft Access MVP

 
Reply With Quote
 
Dorian
Guest
Posts: n/a
 
      30th Dec 2009
Mass updates must be in a transaction.
You can Rollback if an error is encountered.
Read up on this in Access HELP.
-- Dorian
"Give someone a fish and they eat for a day; teach someone to fish and they
eat for a lifetime".


"Brian" wrote:

> Is there a best practice or are there design elements to use or avoid
> regarding the interception and & processing of record-locking conflicts
> during mass update processes?
>
> I already trap error 7878 on forms where users may attempt to edit the same
> record simultaneously, with two different users opening the same record
> simultaneously. This is not a big problem because I can intercept the update
> and notify the user of the conflict as the user is interacting with that
> single record. However, when one user runs a query or SQL statement or opens
> a recordset that will update many records, it is always possible that some
> other user may have one of those records locked on a single-view form.
>
> I can explain best by example: In my current project, I have (among many
> others) a customer table and a route table. RouteID is the PK in the Route
> table and an FK in the Customer table.
>
> If one user has a particular customer record open via a bound (single) form
> and another user attempts to do a mass move of customers, including that
> customer, to a different route, it is fairly easy to deal with the user
> having the single customer form open, but if the mass-update user experiences
> the record-locking error, it will most likely occur in the middle of a query
> affecting 150 records or, worse yet, after three or four steps of a process
> involving dependent steps are completed, leaving some process half-done with
> no way to determine the prior state of the individual records.
>
> Is there, for example, a way to prequery and place a lock on all the records
> to be included in a recordset or query?

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How deal with button to goto a new record =?Utf-8?B?bXNjZXJ0aWZpZWQ=?= Microsoft Access Form Coding 5 5th Aug 2007 12:33 PM
ACCESS 2003 record locking vs page frame locking =?Utf-8?B?c2ltY29u?= Microsoft Access 3 3rd Jul 2006 03:05 PM
HOW DO YOU GET A RECORD DEAL? Damon Cleveland Windows XP Music 0 28th Nov 2004 12:44 AM
Optimistic record locking conflicts. Jim Microsoft Access Form Coding 1 21st Apr 2004 05:18 PM
Maybe we should start a thread on best AMD processor deal since everyones saying they are locking the AMD 2500 Bartons John Computer Hardware 3 9th Nov 2003 09:50 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:27 AM.