Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Record Lock Problem

Record Lock Problem

Record Lock Problem

I am using pessimistic table buffering and when I want to access a locked record I get error 109. After this the application closes immediately. Has anyone a solution for this problem?

RE: Record Lock Problem

The "solution" is to write an error handler to handle this.  Since you are using pessimistic locking, a lock will be attempted when the user starts, rather than at the end/commit of an edit.

I'm sure many folks here have some error  handler routines already developed that they could share; its really the best long-term approach.  Also explore the set reprocess command.

Robert Bradley

FoxDev - Visual FoxPro Development

RE: Record Lock Problem

I have a error handler but I don't know how to handle this error.

RE: Record Lock Problem

 I think jvalk's question is how to prevent the application from abruptly exiting.

 set a breakpoint just before the attempt to access the locked record. Step through and see where and why it terminates.


RE: Record Lock Problem

You're right, Jon:  if the application is simply shutting down without his code directing it to (i.e., his error routine isn't giving up and QUITting), then that is seemingly bizarre.

Generally, the approach in your error handler would be to test for that error number (I assume your ON ERROR routine passes ERROR() as a parameter), then set up a loop for, say, 10 iterations, inserting a pause of a second or so within the loop, and issuing a RETRY each iteration.  

However, one of the problems with pessimistic locking is that if someone starts editing, then gets up and goes to lunch, that hoses the other users - error handling will help you exit gracefully, but won't solve the underlying problem.

Robert Bradley

FoxDev - Visual FoxPro Development

RE: Record Lock Problem

Couple issues besides the error handling
2.  OPTIMISTIC TABLE BUEFFERING is generally the preferred method of buffering.  Don't know if you checked it out

John Durbin

ICQ VFP ActiveList #73897253

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close