Very useful Thank you S
On Fri, Jun 17, 2011 at 7:19 PM, Jean MAURICE <[email protected]>wrote: > Hi Sytze, > > in older days, i used to add a field 'owner' to each table. This field is > normally empty if the record is 'free' and contains the operator's code if > it > used by one operator. it's something like : > > * locking a record > IF RLOCK() > REPLACE mytable.owner WIH operator.code > UNLOCK > ENDIF > > * unlocking a record > REPLACE mytable.owner WITH "" > > *testing if a record is free > IF RLOCK() > IF EMPTY(mytable.owner) > UNLOCK > * the record is free > .... > ELSE > UNLOCK > * the record is used by operator.code > ... > ENDIF > ELSE > * just do another try because you have a bad luck on lock ! > ... > ENDIF > > > So, if an operator has left a record 'locked' (for example the app > crashed), you > can always clear all the fields owner .. > With this algorithm, a record is locked only for a very short time so the > probability of a problem during this short time is very very low; You can > know > who is working; You can 'unlock' a record from outside the app. > > I hope this helps > The Foxil > > > [excessive quoting removed by server] _______________________________________________ Post Messages to: [email protected] Subscription Maintenance: http://leafe.com/mailman/listinfo/profox OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech Searchable Archive: http://leafe.com/archives/search/profox This message: http://leafe.com/archives/byMID/profox/[email protected] ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

