How to set hibernate dialect in Grails 3.0.1
I am testing a new Grails 3 stack and I hit it with gorm / hibernate. I have a custom hibernate dialect to support some database functionality, but the dialect setting in the file application.yml
appears to be ignored:
dataSource:
dialect: "our.namespace.Dialect"
pooled: true
jmxExport: false
driverClassName: "org.postgresql.Driver"
username: user
password: password
dbCreate: 'update'
our.namespace.Dialect
never instantiated and when trying to create database gorm generates the following error:
ERROR org.hibernate.tool.hbm2ddl.SchemaUpdate - HHH000299: Could not complete schema update
org.hibernate.MappingException: No Dialect mapping for JDBC type: 90001
Type 90001 is one of the JDBC type codes that the dialect should deal with.
This code and setup worked well in the Grails 2.xy projects I am working on.
How do I set hibernate dialogs in Grails 3.0.1?
source to share
It looks like this is a known issue with Grails 3.0.1 and has a bug report on it:
https://github.com/grails/grails-core/issues/614
The current workaround is to set the dialect in the hibernate section of the file application.yml
:
hibernate:
dialect: "our.namespace.Dialect"
source to share