hhuijser/liferay-portal — pull request #2184 by yuhai (2014-10-23 07:00:37+00:00)
Title: LPS-51059  Deleting categories fills up transaction log due to repeated sql statements

The issue might be caused by rebuildTree many times when delete lots of Category (for example, 5000 categorys all include subCategorys). Because when delete one category which has subCategorys, we will execute rebuildTree once.

Refer to Julio's solution: After deleting all the categories, we will execute rebuildTree once.
https://in.liferay.com/web/global.engineering/forums/-/message_boards/message/3664418#_19_message_3664945

I have done the fix. Please refer to the PR from https://github.com/yuhai/liferay-portal/compare/LPS-51059?expand=1

The fix removes the original logic "before, we only rebuildTree when we delete one category which have subCategory". At the current, the fix will rebuild tree once after deleting all categories (one or many or vocabulary with all categories).

In addition, in order to keep previous API won't be broken in AssetCategoryLocalServiceImpl class, we keep the original the param "boolean childCategory".

Please help check it.

Thanks,
Hai