[jboss-jira] [JBoss JIRA] Commented: (JBPM-785) Process Instance Deletion failed due to Constraint Voilation "`MYSQL/JBPM_PROCESSINSTANCE`, CONSTRAINT `FK_PROCIN_SPROCTKN` FOREIGN KEY (`SUPERPROCESSTOKEN_`) REFERENCES `JBPM_TOKEN` (`ID_`))"

Tom Baeyens (JIRA) jira-events at jboss.com
Wed Dec 20 06:18:47 EST 2006


    [ http://jira.jboss.com/jira/browse/JBPM-785?page=comments#action_12349121 ] 
            
Tom Baeyens commented on JBPM-785:
----------------------------------

even more then these fixes, i'm interested in the testcases that shows jbpm reproducing this problem.

first of all, i would like to understand the nature of the problem.  i have seen people experiencing this problem before.  but i have not yet been able to find what the cause of the problem is.  therefor, tests reproducing the problem would be most valuable.

i had a brief look at the fixes.  since i don't understand the cause of the problem, i don't see what and why this fixes a problem.

also this part seems strange to me:

      // find the tokens for subprocesses
      Query query = session.getNamedQuery("GraphSession.findTokensForProcessInstance");
      Token rootToken = processInstance.getRootToken();
      rootToken.setSubProcessInstance(null);
      query.setEntity("superProcessToken", rootToken);
      List tokens = query.list(); //tokens of subprocesses

i see you have a different way of trying to get the set of sub process instances.  but this query only fetches the sub processes for the root token.  i don't think that this will find subprocesses of concurrent paths of execution.

if you have test cases that show the problem.

> Process Instance Deletion failed due to Constraint Voilation "`MYSQL/JBPM_PROCESSINSTANCE`, CONSTRAINT `FK_PROCIN_SPROCTKN` FOREIGN KEY (`SUPERPROCESSTOKEN_`) REFERENCES `JBPM_TOKEN` (`ID_`))"
> ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: JBPM-785
>                 URL: http://jira.jboss.com/jira/browse/JBPM-785
>             Project: JBoss jBPM
>          Issue Type: Bug
>          Components: Core Engine
>    Affects Versions: jBPM 3.1.3
>         Environment: ubuntu linux , JBPM 3.1.3 , mysql 5.0.22
>            Reporter: Deepak jAIN
>         Assigned To: Tom Baeyens
>            Priority: Blocker
>             Fix For: jBPM 3.1.4
>
>         Attachments: GraphSession.java, hibernate.queries.hbm.xml
>
>
> I have a complex multi level process scenario where JBPM 3.1.3 was failing to delete a process instance because of the following constraint voilation:
> "`MYSQL/JBPM_PROCESSINSTANCE`, CONSTRAINT `FK_PROCIN_SPROCTKN` FOREIGN KEY (`SUPERPROCESSTOKEN_`) REFERENCES `JBPM_TOKEN` (`ID_`))"
> Here is my usage scenario in more detail:
> Top Level Process P1 has following sub processes
>     -> Sub Process P2
>     -> Sub Process P3
>     -> Sub Process P4 
>           -> Sub Process P41
>     -> Sub Process P5
>     -> Sub Process P6 
> Step1 : I successfully deployed all these processes and was able to successfully execute  
>               "Top Level Process P1".
> Step2 : When I try to undeploy "Top Level Process P1" or delete (undeploy internally calls deleteProcessInstance) process instance of "Top Level 
>               Process P1". I  was getting the the above mentioned constraint voliation:
>               "`MYSQL/JBPM_PROCESSINSTANCE`, CONSTRAINT `FK_PROCIN_SPROCTKN` FOREIGN KEY (`SUPERPROCESSTOKEN_`) REFERENCES 
>               `JBPM_TOKEN` (`ID_`))" 
>               NOTE : MYSQL is my schema in mysql 5.0.22
> I spend a decent amount of time looking at the piece of code in action at
> 1. org.jbpm.db.GraphSession#deleteProcessInstance(ProcessInstance,boolean,boolean,boolean) and 
> 2. org.jbpm.db.GraphSession#deleteSubProcesses(Token)
> 3. org.jbpm.db.hibernate.queries.hbm.xml
> The problem had to do with couple of issues in code like :
> 1. bug in the query to get sub process tokens.
> 2. bug around how sub processes are being deleted in cascade deletion process (recursive code).
> 3. bug arounf the steps to delete the logs of the process instance. 
> NOTE : This bug cause other constraint voilations too which I have fixed as well.
> I have fixed the issue (org.jbpm.db.GraphSession + hibernate.queries.hbm.xml files with change are attached, one can diff this against JBPM 3.1.3 Version to see the change). I have tested this with the above mentioned test scenarios + far more complex scenarios already. 
> Now I need help with w.r.t Next Steps to further get this fix in main code base:
> 1. I will like to checkin/provide some unit tests to add more complex scenarios like the above mentioned to help JBPM community.
> 2. I will like core JBPM dveleopers (tbaeyens or others ) to do a code review of the changes and accept this in main line
> References : 
> http://www.jboss.com/index.html?module=bb&op=viewtopic&t=94218&view=previous  is related but slightly different issue.
> regards,
> dj

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list