Hi,
I'm using Alfresco Enterprise 5.2.3, and I want delete folder with 50.000 - 200.000 documents inside.
I tried delete by public rest API:
alfresco/api/-default-/public/alfresco/versions/1/nodes/30fa7bab-5c3a-46dc-ac32-51eac80008f6?permanent=false
And this is endless query. After few hours in server logs I saw Java heap space error.
Then I wrote custom webscript which call deleteNode method from NodeService, effect was the same.
And my question is, how can I delete that folder without any errors and exception, and in a finite time?
Solved! Go to Solution.
You have to realise that a massive operation like that won't ever be fast. You are also not helping things by specifying permanent=false, which means all the deleted documents will actually be copied into archive / trash can, doubling the amount of operations to be performed (each deleted node will require at least 3 SQL delete,1 insert and 1 update statements - maybe more - , and when you allow archiving to take place you effectively require at least another 4 SQL insert statements). Also, since Alfresco supports event-based processing, for every document that is being deleted it will check if there has been any configured event processing (rule / behaviour) and may execute that defined logic. Of course during the whole operation, Alfresco has to collect / hold a lot of runtime data in-memory, which can lead to memory issues if your server has insufficient resources assigned to it.
It is never a good idea to try and delete (or modify) more than a few hundred elements in a single operation. Your deletion should be implemented as an incremental operation instead of trying to delete the whole folder in one go...
You have to realise that a massive operation like that won't ever be fast. You are also not helping things by specifying permanent=false, which means all the deleted documents will actually be copied into archive / trash can, doubling the amount of operations to be performed (each deleted node will require at least 3 SQL delete,1 insert and 1 update statements - maybe more - , and when you allow archiving to take place you effectively require at least another 4 SQL insert statements). Also, since Alfresco supports event-based processing, for every document that is being deleted it will check if there has been any configured event processing (rule / behaviour) and may execute that defined logic. Of course during the whole operation, Alfresco has to collect / hold a lot of runtime data in-memory, which can lead to memory issues if your server has insufficient resources assigned to it.
It is never a good idea to try and delete (or modify) more than a few hundred elements in a single operation. Your deletion should be implemented as an incremental operation instead of trying to delete the whole folder in one go...
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.