Environment
Novell Teaming 2.1
Novell Vibe 3.x
Novell Vibe 3.x
Situation
When deleting a Teaming / Vibe folder with entries that have a workflow associated with them, the deletion may fail due to a constraint violation and the following error is displayed and logged in the catalina.out file:
WARN [org.hibernate.util.JDBCExceptionReporter] - SQL Error: 1451, SQLState: 23000
ERROR [org.hibernate.util.JDBCExceptionReporter] - Cannot delete or update a parent row: a foreign key constraint fails (`sitescape/jbpm_log`, CONSTRAINT `FK_LOG_PARENT` FOREIGN KEY (`PARENT_`) REFERENCES `jbpm_log` (`ID_`))
WARN [org.kablink.teaming.module.folder.impl.DefaultFolderCoreProcessor] - Error delete folder /Home Workspace/Personal Workspace/Jake Schnakenburg (jschnakenburg)/File Folder
org.springframework.dao.DataIntegrityViolationException: could not execute update query; SQL [delete from JBPM_LOG where TOKEN_ in (? , ?)]; constraint [null]; nested exception is org.hibernate.exception.ConstraintViolationException: could not execute update query
WARN [org.hibernate.util.JDBCExceptionReporter] - SQL Error: 1451, SQLState: 23000
ERROR [org.hibernate.util.JDBCExceptionReporter] - Cannot delete or update a parent row: a foreign key constraint fails (`sitescape/jbpm_log`, CONSTRAINT `FK_LOG_PARENT` FOREIGN KEY (`PARENT_`) REFERENCES `jbpm_log` (`ID_`))
WARN [org.kablink.teaming.module.folder.impl.DefaultFolderCoreProcessor] - Error delete folder /Home Workspace/Personal Workspace/Jake Schnakenburg (jschnakenburg)/File Folder
org.springframework.dao.DataIntegrityViolationException: could not execute update query; SQL [delete from JBPM_LOG where TOKEN_ in (? , ?)]; constraint [null]; nested exception is org.hibernate.exception.ConstraintViolationException: could not execute update query
Resolution
Execute the following SQL to remove all rows from the JBPM_LOG table:
UPDATE JBPM_LOG SET PARENT_=null;
DELETE FROM JBPM_LOG;
UPDATE JBPM_LOG SET PARENT_=null;
DELETE FROM JBPM_LOG;