Home Forums Development Parallel update of object on UI click event

Viewing 1 reply thread
  • Author
    Posts
    • #10461
      nexj uaenexj uae
      Participant

      [Pravin]- Whenever an user approves a SR, we want to update all the child service request linked to the parent SR, but this update is very slow and user gets blocked in the screen for 30-45 secs. We want to update each child in separate thread to process each child in parallel (like parallel for each loop of C#). Please provide some code samples to achieve this functionality.

      Each child will query the same parent SR. How to handle this scenario to avoid locking issue in parallel thread.

      0
    • #10490
      Jenish JayakumarJenish Jayakumar
      Participant

      Hi Pravin,

      SR child-parent relationship is not an OOB pattern. I assume the implementation you’re talking about is the re-designing work of parent-child model, where a SR can be approved/rejected directly at the parent level and the decision should roll out.

      From your question I assume that your current implementation tries to update all the service requires [parent and child] synchronously.

      As mentioned by you, based on the logic and multiple dependent actions, this process could be slow.

      The other approach could be to make the child approve/reject processes async and this can be achieved through existing implementation model across the application.

      Please search for code (SysQueue’invoke . By creating a separate queue and setting the concurrency the expected process can be completed asynchronously with minimal delay/slowness in the UI. Doing updates on each child SR parallelly is not suggested as this may result in deadlock or exceptions being thrown which can make the user to do the same action multiple times.

      Async process will run in the background after the main action. The subsequent actions will get completed based on the queue and channel.

      0
Viewing 1 reply thread
  • You must be logged in to reply to this topic.