Uploaded image for project: 'JBoss BPMS Platform'
  1. JBoss BPMS Platform
  2. RHBPMS-1330

Add database upgrade scripts to BPMS distribution

XMLWordPrintable

      Description of problem:

      Migration from 6.x to 6.y would include database schema changes. Schema update is processed by Hibernate. But if a column is newly added to a table, the value will be 'null' when migrated.

      Community installer includes upgrade-scripts to populate such columns.

      https://github.com/droolsjbpm/jbpm/tree/master/jbpm-installer/db/upgrade-scripts

      I think we need to include the scripts in our distribution (e.g. supplementary-tools) and let them involved in our QA migration test.

      Steps to Reproduce:
      1. Start a process instance with PerProcessInstanceRuntimeManager in BPMS 6.0.3. The process instance waits at a User Task.
      2. Migrate the database to BPMS 6.1.0. (hibernate.hbm2ddl.auto=update)
      3. Look at ContextMappingInfo table
      4. Resume the process instance in BPMS 6.1.0

      Actual results:

      ContextMappingInfo.OWNER_ID is NULL.

      mysql> select * from ContextMappingInfo;
      -----------------------------------------------

      mappingId CONTEXT_ID KSESSION_ID OPTLOCK OWNER_ID

      -----------------------------------------------

      1 1 2 0 NULL

      -----------------------------------------------

      Get SessionNotFoundException when calling RuntimeEngine.getKieSession()

      2015-06-22 09:56:25,738 ERROR [http-8080-7]
      org.kie.internal.runtime.manager.SessionNotFoundException: No session found for context 1
      at org.jbpm.runtime.manager.impl.PerProcessInstanceRuntimeManager$PerProcessInstanceInitializer.initKieSession(PerProcessInstanceRuntimeManager.java:442)
      at org.jbpm.runtime.manager.impl.RuntimeEngineImpl.getKieSession(RuntimeEngineImpl.java:70)

      Expected results:

      A user run the update script after the step 2. Now OWNER_ID (and other columns) are populated.

      RuntimeEngine.getKieSession() doesn't throw an Exception.

              rzhang+1@redhat.com Cheng Zhang (Inactive)
              rhn-support-tkobayas Toshiya Kobayashi
              Tibor Zimányi Tibor Zimányi
              Tibor Zimányi Tibor Zimányi
              Alessandro Lazarotti, Kris Verlaenen, Lukáš Petrovický (Inactive), Marek Baluch, Martin Weiler (Inactive), Rajesh Rajasekaran, Tibor Zimányi
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: