TAMULib / mod-workflow

Apache License 2.0
0 stars 0 forks source link

H2 does not appear to be supported. #121

Open kaladay opened 10 months ago

kaladay commented 10 months ago

Some developers just need to spin up a Docker Container locally to perform tests. Using H2 seems ideal in this case.

H2 appears to be unsupported because of the failure message below.

The fw build command is failing in mod-workflow when using H2.

$ fw build my-test-workflow
(node:2140) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
failed post http://localhost:9001/mod-workflow/triggers {
  id: '04a4ad57-c205-4c77-b7de-2a5015cd6b58',
  name: "Rajdeep's Workflow Start Trigger",
  description: 'Rest Post Endpoint',
  type: 'MESSAGE_CORRELATE',
  method: 'POST',
  deserializeAs: 'EventTrigger',
  pathPattern: '/events/workflow/my-test-workflow/start'
}
{
  errors: [
    {
      message: 'Could not alter JDBC connection to use schema [tamu_workflow_service]',
      type: 'HibernateException',
      code: '500 INTERNAL_SERVER_ERROR',
      parameters: []
    }
  ],
  total_records: 1
}

The Docker image (built using the build_and_run Dockerfile) is run using the following environment variables and settings:

export SPRING_JPA_DATABASEPLATFORM="org.hibernate.dialect.H2Dialect"
export SPRING_DATASOURCE_PLATFORM="h2"
export SPRING_DATASOURCE_DRIVERCLASSNAME="org.h2.Driver"
export SPRING_DATASOURCE_URL="jdbc:h2:./mod-workflow;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE"
export SPRING_SQL_INIT_PLATFORM="h2"

docker run -d -p 9001:9001 -p 61616:61616 -e "SPRING_JPA_DATABASEPLATFORM=$SPRING_JPA_DATABASEPLATFORM" -e "SPRING_DATASOURCE_PLATFORM=$SPRING_DATASOURCE_PLATFORM" -e "SPRING_DATASOURCE_DRIVERCLASSNAME=$SPRING_DATASOURCE_DRIVERCLASSNAME" -e "SPRING_DATASOURCE_URL=$SPRING_DATASOURCE_URL" -e "SPRING_SQL_INIT_PLATFORM=$SPRING_SQL_INIT_PLATFORM" -e "SERVER_PORT=9001" mod-workflow