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

Deepak jAIN (JIRA) jira-events at jboss.com
Fri Nov 17 19:05:41 EST 2006


     [ http://jira.jboss.com/jira/browse/JBPM-785?page=all ]

Deepak jAIN updated JBPM-785:
-----------------------------

    Description: 
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:
              "`LE_OLTP/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

  was:
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:

"`LE_OLTP/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:
              "`LE_OLTP/JBPM_PROCESSINSTANCE`, CONSTRAINT `FK_PROCIN_SPROCTKN` FOREIGN KEY (`SUPERPROCESSTOKEN_`) REFERENCES 
              `JBPM_TOKEN` (`ID_`))" 
              NOTE : LE_OLTP 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


> Process Instance Deletion failed due to Constraint Voilation "`LE_OLTP/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
>         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:
>               "`LE_OLTP/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