AnsweredAssumed Answered

How to solve: some operations in webscript requires a long time to finish

Question asked by sunquanbin on May 16, 2014
Latest reply on May 19, 2014 by kaynezhang
Hi Everyone,

I'm using Java-back webscript handler for Alfresco webscript and I have encountered one problem:

In the Java handler, some operations take quite a long time to finish. Currently the time is only around 10-20s but it may become over minutes in the future. I don't want the user to wait in front of the monitor for minutes (there is perhaps a timeout issue as well).

To be more specific, what the java codes do are:

1. Create about 1000 nodes in Alfresco.
2. Connect to another DB and do some operations (takes minutes).
3. If step 2 failed, delete everything created in step 1.
4. Write the response via the WebScriptResponse writer.

So can I ask is there a suggested solution (or probably a built-in mechanism?) to this case in Alfresco (e.g. run step 2 asynchronously?).

Regards,

Sun 

Outcomes