What I have done is to have another app that processes this type of activity and the main app just writes a "request" into a table that the processing app polls. So any number of users can submit requests for processing and have them accepted, but they are only processed sequentially, with an email or other notification when completed.
Chuck On 2015-03-05, 9:15 AM, "OC" wrote: Hello there, there are some activities of my application which should do only one instance (e.g., archivation of objects). At the moment, I intend to (a) add to my DB a specific table, say, T_LOCK; its rows would contain (at least) ACTIVITY_ID (PK or at least UNIQUE), USER_NAME, and TIME_STAMP; (b) when an instance is about to start an activity, it would first insert a new row into that table - if it fails, it would fetch the current row for given ACTIVITY_ID and would log (or, if interactive, say to the user): "Sorry pal, but USER_NAME started this at TIME_STAMP, so we do nothing at the moment; try later" - if it suceeds, it would start the activity and when done, delete the row. Plus I guess I will have to add a possibility for some highly trusted administrator user to display the whole table and to delete any of its rows, in case e.g., the instance which did the activity crashed before deleting its lock. Since this seems to be pretty ubiquitous task for any multi-instance app, I'd be grateful for comments from all of you who unlike me do multi-instance for years: is this a good idea, or should I try to find another solution? Am I overlooking something which would in a couple of weeks or months raise its ugly head and bite me in the tender parts? Thanks a lot, OC _______________________________________________ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list ([email protected]<mailto:[email protected]>) Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/webobjects-dev/chill%40gevityinc.com This email sent to [email protected]<mailto:[email protected]>
_______________________________________________ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list ([email protected]) Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to [email protected]
