Skip to content

Add missing HSQL create and drop scripts for the app, DMN and event registry engines - #4333

Open
omartitouhi wants to merge 1 commit into
flowable:mainfrom
omartitouhi:fix-4009-hsql-scripts
Open

omartitouhi wants to merge 1 commit into
flowable:mainfrom
omartitouhi:fix-4009-hsql-scripts

Conversation

@omartitouhi

Copy link
Copy Markdown

Fixes #4009

Since 7.1.0 the app, DMN and event registry engines create their schema from SQL scripts, but no HSQL scripts were added for them. Starting any of these engines on HSQL fails with:

FlowableException: resource 'org/flowable/app/db/create/flowable.hsql.create.app.sql' is not available

Changes

  • Add flowable.hsql.create/drop.{app,dmn,eventregistry}.sql. They are copies of the H2 scripts. All create statements are valid HSQL.
  • HSQL does not accept cascade constraints in drop table. It only accepts cascade, which the engine and IDM HSQL drop scripts already use. The new drop scripts use cascade. The existing CMMN and common HSQL drop scripts also used cascade constraints, so every drop table in them failed and the tables were never dropped. They now use cascade too.

Testing

I ran the existing test suites against an in-memory HSQL database:

-Djdbc.url=jdbc:hsqldb:mem:flowable -Djdbc.driver=org.hsqldb.jdbcDriver -Djdbc.username=sa

The DMN and event registry modules don't have hsqldb as a test dependency, so for those I added the driver with -Dmaven.test.additionalClasspath.

Module Before After
flowable-app-engine every test fails with the error above 69/69 pass
flowable-dmn-engine DmnEngineDropScriptsTest fails 201/201 pass
flowable-event-registry EventEngineDropScriptsTest fails 72/72 pass
flowable-cmmn-engine (CmmnEngineDropScriptsTest) drop statements fail with unexpected token: CONSTRAINTS passes

This PR adds no HSQL upgrade scripts. Every HSQL database that uses these engines failed at startup on 7.1.0 or later, so no schema was ever created on those versions. A file-based HSQL database created on 7.0 or earlier would still skip the H2-only DMN and event registry steps 7200→7201 and 8101→8102, like the other engines that only ship some HSQL upgrade steps. I can add HSQL copies of those steps if you want them.

Check List:

  • Unit tests: NA (existing *DropScriptsTest and engine tests cover this when run on HSQL; there is no HSQL CI job)
  • Documentation: NA

…egistry engines

The app, DMN and event registry engines had no HSQL schema scripts since
7.1.0, so starting them on HSQL failed. The new scripts are copies of the
H2 ones, with 'cascade constraints' replaced by 'cascade' in the drop
scripts since HSQL rejects the former. The existing CMMN and common HSQL
drop scripts had the same problem and are fixed too.

Fixes flowable#4009

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing HSQL create scripts in 7.1.0

1 participant