Flavio Donadio <fla...@donadio.com.br> writes: > The interface will be like in Address Book: the user opens a > card/record for viewing, but has to click an "Edit" button to make > changes. If the record is locked, the user will get an alert when > he/she clicks the button. I need:
> 1. A mechanism to avoid users opening records for editing and > leaving them open "forever" (timer?); > 2. Some kind of feedback for the users when a record is unlocked, > without having to refresh manually. I would not go this route. Have a look at network file systems like Windows SMB for how ugly this can get (but maybe you can find there some inspiration for your solution; Microsoft did quite some changes in this area for the latest releases of the SMB protocol). I would prefer the classic ORM optimistic locking approach: Just use a special field in the database (e.g. a simple integer field called "version"). On each write do something like "UPDATE ... WHERE version = X and objectid = Y". If this fails (0 records updated), then someone else updated the record in the meantime (between clicking on Edit and clicking on Save) and you may present the user an error message (maybe with the option to merge or overwrite the other changes). In many use cases this will lead to very few messages due to record version mismatches, there are no stale locks and the implementation is quite simple (except for some kind of merge algorithm). -- Until the next mail..., Stefan. _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com