We are using code to check if a folder exists and if not, then create it. This is working fine and am able to generate a complete folder structure.
However, we are doing a conversion involving many concurrent requests to the API and if two come in with the same path at the exact same time, we are getting an exception.
org.alfresco.service.cmr.model.FileExistsException: 07040021 File or folder New Folder already exists
This seems at odds with the documentation which says if the createFolder fails it will return null.
I've seen several sets of code in the Hub that shows the same approach as I am using, but nothing that seems like it would mitigate this issue. Anyone have any ideas? I tried doing a try/catch block around the createFolder and that seemed to stop the exception but we always ended up in the catch block whether the createFolder should have worked or not.