I'm working on a creating a scripted rule for a folder that should update a counter (integer) property defined on an aspect associated with the folder.
The idea is that someone drops a file/document into the folder, some business logic runs then the document is moved to another folder. The final steps read the current value of the "counter", increments that value by 1, then saves the value.
Is there a way to ensure that if 2 or more documents are dropped into the folder at the same time that the counter is updated correctly? If Alfresco is running the rule for each of the dropped documents concurrently, is it possible that they obtain the same current value of the counter and then increment it, causing the counter to have the wrong value?