I am writing a code using Apache Chemistry APIs to connect to an Alfresco repository. My code goes like this -
Step 1 - Create folders
Step 2 - Create document with only metadata and no content inside those folders.
Step 3 - Push content into those documents.
The first time it runs fine. Then I delete the folder using Alfresco Share UI and not using Apache Chemistry APIs. Then I run the same code again. The next time the folders get created but while creating the document it says -
Parent folder not found: 9ffbf884-0aa5-49df-84e0-feea797b2f20
After debugging, I found out that the ID belongs to the folder that was created the first time the code was executed. Somehow, the cache was holding the old folder ID and was not refreshed when I created the folder with same name the second time.
To resolve this, I disabled caching and the code worked fine.
What are the implications of switching of the cache? Would it cause a big hit to the performance of the system? There are substantial calls being made to the content repository. Any other suggestions to resolve this issue are welcome.