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.
Created attachment 1042585 [details] BZ1235091_reproducer.zip Attached BZ1235091_reproducer.zip. See README.txt in the zip.
Ryan, could you add these migration scripts we have in the installer in the community to the supplementary tools?
Ok, will do it in ER3.
We need it properly documented in Migration Guide.
Important: As we did not offer this to product 6.0 to 6.1, we need to offer a script that can migrate customers using 6.1 but also for those using 6.0, to 6.2.
See that such scripts needs to have the name changed. They are two scripts mentioning migration from 6.0 to 6.1 and 6.1 to 6.2, while in fact the product 6.1 is == community 6.2, so this naming can confuse customers. I am not sure if there is a 6.2 to 6.3 in community at this point but we need to align the named versions with product versions. Maybe adding as bame bpms61-to-bpms62 as example.
And sure, the scripts must support migration from product 6.1 to 6.2 and migration from 6.0 to 6.2.
I have added the following into supplementary-tools: jboss-brms-bpmsuite-6.2-supplementary-tools/ upgrade-scripts/ ├── db2 │ ├── bpmsuite-6.0-to-6.1.sql │ └── bpmsuite-6.1-to-6.2.sql ├── h2 │ ├── bpmsuite-6.0-to-6.1.sql │ └── bpmsuite-6.1-to-6.2.sql ├── mysql5 │ ├── bpmsuite-6.0-to-6.1.sql │ └── bpmsuite-6.1-to-6.2.sql ├── oracle │ ├── bpmsuite-6.0-to-6.1.sql │ └── bpmsuite-6.1-to-6.2.sql ├── postgresql │ ├── bpmsuite-6.0-to-6.1.sql │ └── bpmsuite-6.1-to-6.2.sql ├── sqlserver │ ├── bpmsuite-6.0-to-6.1.sql │ └── bpmsuite-6.1-to-6.2.sql └── sybase ├── bpmsuite-6.0-to-6.1.sql └── bpmsuite-6.1-to-6.2.sql Is there anything missing?
Added bpms-* upgrade scripts as well: master: http://github.com/droolsjbpm/jbpm/commit/137a5f946 6.3.x: http://github.com/droolsjbpm/jbpm/commit/54a751ed9 @Ryan, please pick up these (instead of the rename you suggested before).
(In reply to Kris Verlaenen from comment #17) > Added bpms-* upgrade scripts as well: > master: http://github.com/droolsjbpm/jbpm/commit/137a5f946 > 6.3.x: http://github.com/droolsjbpm/jbpm/commit/54a751ed9 > > @Ryan, please pick up these (instead of the rename you suggested before). I see and will do. Thanks Kris!
I believe all related issues have been fixed. Mark this as MODIFIED.
Found some issues with this: - In supplementary tools there should be bundled also scripts for mysql with innodb. There is a separate folder with these scripts in jbpm-installer module alongside normal mysql5 scripts (named mysqlinnodb). - There was a mistake in sqlserver scripts. See issue here [1]. I made a PR for this - link in mentioned issue. - In DB2 scripts, SessionInfo id column datatype was not properly updated when there were no sessions stored in SessionInfo table. See issue here [2]. After discussion with @fspolti, I made a PR also for this - link in mentioned issue. Other scripts passed fine. [1] https://issues.jboss.org/browse/JBPM-4825 [2] https://issues.jboss.org/browse/JBPM-4826
Tibor, are there BZs opened about the issues above ?
- The SessionInfo id BZ is here [1]. - The InnoDB thing is now not tracked in BZ and the SQLServer scripts thing is tracked only in JIRA [2] for now, because I think these issues are related to this BZ (newly created productized scripts and packaging them to supplementary tools). But if it is needed to track them separately, I will create the tickets. Please, let me know. [1] https://bugzilla.redhat.com/show_bug.cgi?id=1272120 [2] https://issues.jboss.org/browse/JBPM-4825
Both pull requests related to the second and third issue mentioned in comment 22 were merged to 6.3.x: https://github.com/droolsjbpm/jbpm/commit/751359c9bbca1b49e850723b9f527b8cd220f7d6 https://github.com/droolsjbpm/jbpm/commit/b29c4fd348b33821623930c4631db8d282ba8e35 Keeping it assigned to Ryan for the mysql innodb fix.
(In reply to Kris Verlaenen from comment #26) > Both pull requests related to the second and third issue mentioned in > comment 22 were merged to 6.3.x: > https://github.com/droolsjbpm/jbpm/commit/ > 751359c9bbca1b49e850723b9f527b8cd220f7d6 > https://github.com/droolsjbpm/jbpm/commit/ > b29c4fd348b33821623930c4631db8d282ba8e35 > > Keeping it assigned to Ryan for the mysql innodb fix. OK, I have added mysql innodb into the supplementary tools. @Tibo, However, I can't find the dashbuilder sql for mysql innodb. Shoud we assign this to dashbuilder owner to add the mysql innodb? Let me mark this as MODIFIED for test on CR1 first.
Retested the scripts, the fixes I mentioned in previous comments are resolved, everything passed except one problem I found. See JIRA here [1]. I made PRs for this: Master: https://github.com/droolsjbpm/jbpm/pull/343 6.3.x: https://github.com/droolsjbpm/jbpm/pull/344 When this is merged into scripts, I think we are fine with this issue and I can verify it. [1] https://issues.jboss.org/browse/JBPM-4843
Petr, see comment 30 - this needs to be documented in the release notes.
Setting this to MODIFIED, because semicolon issue is not a blocker and can be merged into later versions. I created new BZ, so we have this tracked separately [1]. [1] https://bugzilla.redhat.com/show_bug.cgi?id=1284367
So no other issues found. I'm verifying this.
Created JIRA for the release note: https://issues.jboss.org/browse/BXMSDOC-105