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.
Help/Unsubscribe/Update your Subscription: