13 Replies Latest reply on Jan 22, 2008 2:30 AM by David Roberts

    problem while deleting processInstance

    ismail seyfi Newbie

      Hi,

      I am trying to delete a processIntance using GrapSession object. What I have looks like

      GraphSession session = context.getGraphSession();
      ProcessInstance processInstance = null;
      if (session != null) {
      processInstance = session.getProcessInstance(processInstanceId);
      if (processInstance != null) {
      session.deleteProcessInstance(processInstance);
      }
      }

      When I do this i get a hibernate exception.


      org.springframework.dao.DataIntegrityViolationException: Hibernate operation: Could not execute JDBC batch update; SQL [delete from JBPM_MODULEINSTANCE where ID_=?]; Cannot delete or update a parent row: a foreign key constraint fails (`forms/jbpm_swimlaneinstance`, CONSTRAINT `FK_SWIMLANEINST_TM` FOREIGN KEY (`TASKMGMTINSTANCE_`) REFERENCES `jbpm_moduleinstance` (`ID_`)); nested exception is java.sql.BatchUpdateException: Cannot delete or update a parent row: a foreign key constraint fails (`forms/jbpm_swimlaneinstance`, CONSTRAINT `FK_SWIMLANEINST_TM` FOREIGN KEY (`TASKMGMTINSTANCE_`) REFERENCES `jbpm_moduleinstance` (`ID_`))
      java.sql.BatchUpdateException: Cannot delete or update a parent row: a foreign key constraint fails (`forms/jbpm_swimlaneinstance`, CONSTRAINT `FK_SWIMLANEINST_TM` FOREIGN KEY (`TASKMGMTINSTANCE_`) REFERENCES `jbpm_moduleinstance` (`ID_`))

      am I missing something?

      thanks