AnsweredAssumed Answered

webscript synchronized problem

Question asked by redybol2013 on Dec 25, 2012
Latest reply on Apr 8, 2013 by iblanco
hello everyone:

I hvae meet a problem about execute a same webscrpit twice at the same time.
The second webscript executed when the first's unfinished.
The main job of the webscript is updating or creating node by a imported file.
Before the creating node, script will check the same name node existed or not.
only the unexisted condition that occuring the creating execution.

Here is the problem:
if the first webscript create a node named "AAA" and commit to the UserTransaction

(UserTransaction transaction = serviceRegistry.getTransactionService().getUserTransaction())

then the second webscript also need to create node "AAA",
but this time, the exeisting check of second webscript is uneffected.
so the second webscript will occure a DuplicateChildNodeNameException;
   "org.alfresco.service.cmr.repository.DuplicateChildNodeNameException: Duplicate child name not allowed: AAA"

so will  webscript synchronize data before it finished the executing?

so is anyone have faced the problem like this before?
Thanks for the help first~

Outcomes