Description of problem: #39279 on Postgres & Oracle. If multiple users are publishing and unpublishing content, database deadlocks may occur. The root of the problem may be the following stack trace, which occurs in Oracle before the deadlock exceptions are encountered: java.lang.IllegalStateException: Attempt to delete non-empty folder [com.arsdigita.cms.Folder:{id=337}]; only empty folders can be deleted at com.arsdigita.cms.Folder.delete(Folder.java:158) at com.arsdigita.cms.ContentItem.setLive(ContentItem.java:1168) at com.arsdigita.cms.ContentItem.unpublish(ContentItem.java:1274) at com.arsdigita.cms.Folder.unpublish(Folder.java:364) at com.arsdigita.cms.ContentItem.setLive(ContentItem.java:1178) at com.arsdigita.cms.ContentItem.unpublish(ContentItem.java:1274) at com.arsdigita.cms.ContentItem.setLive(ContentItem.java:1178) at com.arsdigita.cms.ContentItem.unpublish(ContentItem.java:1274) at com.arsdigita.cms.ui.lifecycle.ItemLifecycleItemPane$UnpublishLink$Listener.actionPerformed(ItemLifecycleItemPane.java:126) What appears to be happening is that Publishing is a separate thread that takes an Item from Pending to Live. When a different login Unpublishes the only item in a folder, it attempts to delete the 'empty' Live folder as part of the transaction. However, the Publish task has, in the interim, put a Live item in that folder. This is possible as we do not do the sort of table/row level locking that would prevent it.
Created attachment 96961 [details] CCM log running on oracle
Created attachment 96962 [details] CCM Llog running on Postgres
Test: //cms/internal/dev/test/src/com/arsdigita/cms/httpunit/CMSTester.java Next step: examine database logs & lock file to verify this is the source of the locking problem.
Cleaning up stale bugs.