• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: blocking other instances from activity
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: blocking other instances from activity


  • Subject: Re: blocking other instances from activity
  • From: Chuck Hill <email@hidden>
  • Date: Thu, 05 Mar 2015 17:34:04 +0000
  • Thread-topic: blocking other instances from activity

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@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: blocking other instances from activity
      • From: OC <email@hidden>
References: 
 >blocking other instances from activity (From: OC <email@hidden>)

  • Prev by Date: blocking other instances from activity
  • Next by Date: Re: NPE in Wonder code
  • Previous by thread: blocking other instances from activity
  • Next by thread: Re: blocking other instances from activity
  • Index(es):
    • Date
    • Thread