FMPRO-L Archives

December 2011, Week 4

FMPRO-L@LISTSERV.DARTMOUTH.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Corn Walker <[log in to unmask]>
Reply To:
FileMaker Pro Discussions <[log in to unmask]>
Date:
Tue, 27 Dec 2011 08:30:41 -0500
Content-Type:
text/plain
Parts/Attachments:
text/plain (19 lines)
On Dec 23, 2011, at 5:52 AM, Steve Cassidy wrote:

> Obviously, you need some refinements to this, such as to prevent the loop continuing for ever. But that's the basic principle.

One refinement is that entering a field is no longer sufficient to lock a record. You should use the Open Record[] command to do so, which should return error 301 if the record is in use.

> Back in the day, I and others tested this with scripts that created thousands of serial-numbered records running concurrently on multiple machines. I never saw a duplicate. Eric Scheid, who hosts the Filemaker Experts mailing list, concurred that this method was reliable. In my book, approval by Eric means it must be pretty bomb-proof....

What you've described is what's known as a "race condition" and you are proposing use of a lock to address it. The particular way you've addressed it is called "test and set lock" using FMP's record locking as a way to do it atomically.


Cheers,
-corn


Cornelius Walker
The Proof Group
http://proofgroup.com/

ATOM RSS1 RSS2