| Summary: | JBPM doesn't create tables automatically for "org.jbpm.persistence.jpa" persistence unit | ||
|---|---|---|---|
| Product: | [Retired] JBoss BPMS Platform 6 | Reporter: | Ivo Bek <ibek> |
| Component: | jBPM Core | Assignee: | Ryan Zhang <rzhang> |
| Status: | CLOSED CURRENTRELEASE | QA Contact: | Ivo Bek <ibek> |
| Severity: | medium | Docs Contact: | |
| Priority: | high | ||
| Version: | 6.0.0 | CC: | mbaluch, rrajasek, rzhang |
| Target Milestone: | ER 7 | ||
| Target Release: | 6.0.0 | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2014-08-06 20:10:46 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
|
Description
Ivo Bek
2013-11-29 08:34:08 UTC
Lowering severity as this is in the test module and there's an easy workaround. Well the hibernate.hbm2ddl.auto property is set but to "validate" which won't create the tables. So it might be enough to change it to "create-drop" or make it possible to set it in JbpmJUnitBaseTestCase. Ivo, this doesn't seem to be the case in jbpm 6.0.x branch in the community: https://github.com/droolsjbpm/jbpm/blob/6.0.x/jbpm-test/src/main/resources/META-INF/persistence.xml#L57 Do you know why there is a difference, and if so, why we shouldn't revert it? Hi Ryan, thank you for the explanation, I don't understand much but it's important to know it's not made by an accident. Then I suggest to change JbpmJUnitBaseTestCase a little. On the line https://github.com/droolsjbpm/jbpm/blob/master/jbpm-test/src/main/java/org/jbpm/test/JbpmJUnitBaseTestCase.java#L184 where you create the EntityManagerFactory (emf = Persistence.createEntityManagerFactory(persistenceUnitName);), I would add a map as the optional parameter, containing the hibernate.hbm2ddl.auto property to override the "validate" value with "update", so only if JbpmJUnitBaseTestCase were used with persistence, the tables would be created. Ryan, the persistence.xml is in the jbpm-test module, it should only be included for JUnit tests (where you can easily instantiate a test environment, using H2 and bitronix). It seems unlikely FSW needs this jar (if they are using it, it might be worth checking why, because I believe it should probably be excluded). So I would recommend to change the hibernate.hbm2dll.auto property back to update, as I believe this should not impact FSW. FSW should define their own persistence.xml (similar to how our workbench for example defines one - https://github.com/droolsjbpm/kie-wb-distributions/blob/master/kie-wb/kie-wb-webapp/src/main/resources/META-INF/persistence.xml), and there they can set their own properties. Setting as blocker as this needs to be resolved, otherwise the jbpm-test jar will be useless. Ok, Kris, I can recover the proprety to update now. FSW don't need this jar. The reason it patched the jbpm-test.jar is to make hibernateMavenPlugin working which is design to generate DB schemal from persistence.xml. If I understand correctly, the plugin will scan all persistence.xml in jbpm and generating the db schema. I would discuss with my colleage about if FSW should use their own persistence.xml or not. But for now, because decision has been made that FSW will freeze on droolsjbpm version (ER5), until GA. So we can fix this issue as you suggested without any impact to FSW. (In reply to Kris Verlaenen from comment #7) > Ryan, the persistence.xml is in the jbpm-test module, it should only be > included for JUnit tests (where you can easily instantiate a test > environment, using H2 and bitronix). > > It seems unlikely FSW needs this jar (if they are using it, it might be > worth checking why, because I believe it should probably be excluded). So I > would recommend to change the hibernate.hbm2dll.auto property back to > update, as I believe this should not impact FSW. > > FSW should define their own persistence.xml (similar to how our workbench > for example defines one - > https://github.com/droolsjbpm/kie-wb-distributions/blob/master/kie-wb/kie-wb- > webapp/src/main/resources/META-INF/persistence.xml), and there they can set > their own properties. Verified in BPMS 6.0.0.ER7 |