6 Replies Latest reply on Jul 8, 2009 10:12 AM by kukeltje

    SQL error executing test process

    ajvarela

      Hi,

      I have developed a simple process but when I run it with a unit test I've got this error:

      18:32:46,762 SEV | [Db] FIXME: JBPM-2004 2 records left in table JBPM4_HIST_PROCINST
      18:32:46,800 WRN | [JDBCExceptionReporter] SQL Error: 1025, SQLState: HY000
      18:32:46,800 SEV | [JDBCExceptionReporter] Error on rename of '.\jbpmdb\jbpm4_comment' to '.\jbpmdb\#sql2-8f8-30' (errno: 152)


      Im using jBPM 4.0CR1 + jBoss 5.0.0GA + MySQL 5.0

      Thank you!!.

        • 1. Re: SQL error executing test process
          jbarrez

          ould you post this unit test?

          • 2. Re: SQL error executing test process
            ajvarela

            Im using this test:

            public class workflowTest extends JbpmTestCase {
            
             long deploymentDbid;
            
             //Variables
             Integer A = 1;
             Integer B = 1;
             Integer C = 0;
             Integer D = 1;
             Integer E = 1;
             Integer F = 1;
            
            
             protected void setUp() throws Exception {
             super.setUp();
            
             deploymentDbid = repositoryService.createDeployment()
             .addResourceFromClasspath(
             "org/workflow/quivir/workflowSumMul.jpdl.xml").deploy();
             }
            
             protected void tearDown() throws Exception {
             repositoryService.deleteDeploymentCascade(deploymentDbid);
            
             super.tearDown();
            
             }
            
             public void testWorkflowProcess() {
             Map<String, Integer> variables = new HashMap<String, Integer>();
             // Entradas
             variables.put("a", A);
             variables.put("b", B);
             variables.put("c", C);
             variables.put("d", D);
             variables.put("e", E);
             variables.put("f", F);
            
             ProcessInstance processInstance = executionService
             .startProcessInstanceByKey("workflowSumMul", variables);
             }
            }


            I have detected that the problem occur in the tearDown method when super.tearDown() is called.



            • 3. Re: SQL error executing test process
              shekharv

              Does not seem to be a jbpm error per se. If anything the create-drop hibernate config option that you likely have in your jbpm.hibernate.cfg.xml seems to the root cause. Try not recreating the schema everytime you run the test case and it 'should' go away.

              This could mean though that the jbpm mysql sql script files might need to be changed a little? But again it is only in the test case world that you would recreate the tables everytime.

              http://bugs.mysql.com/bug.php?id=21395

              • 4. Re: SQL error executing test process
                kukeltje

                could also be caused by a wrong dialect (afair, I've had the same thing before once, though not jBPM related)

                • 5. Re: SQL error executing test process
                  ajvarela

                  Thank you all for replies.

                  I dont know how I can prevent the recreation of DB schema. I have tried comment the tearDown mehod code and the test run well but
                  residual information is saved on DB when I reactive the tearDown code the error appear again.


                  This is my config for MySQL. Is correct dialect??

                  <property name="hibernate.dialect">org.hibernate.dialect.MySQLInnoDBDialect</property>
                   <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
                   <property name="hibernate.connection.url">jdbc:mysql://localhost:3306/jbpmdb</property>
                   <property name="hibernate.connection.username">root</property>
                   <property name="hibernate.connection.password">*********</property>
                   <property name="hibernate.format_sql">true</property>
                  


                  • 6. Re: SQL error executing test process
                    kukeltje

                    Dialect is correct.

                    recreation of