Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Grails 3.0.1 dialect setting in application.yml does not work #614

Closed
todoubaba opened this issue Apr 7, 2015 · 6 comments
Closed

Grails 3.0.1 dialect setting in application.yml does not work #614

todoubaba opened this issue Apr 7, 2015 · 6 comments

Comments

@todoubaba
Copy link

environments:
    development:
        dataSource:            
            dialect: ...
@todoubaba
Copy link
Author

The configClass in dataSource does not work too.

The workaround is setting them in hibernate section:

hibernate:
    config_class: ...
    dialect: ...

@rennerDa
Copy link

I can confirm that your workaround is working :)
The class HibernateDialectDetectorFactoryBean implements the interface GrailsApplicationAware, but at startup inside the method afterPropertiesSet the grailsApplication is null, therefore the config is also null ->
Config config = grailsApplication == null ? null : grailsApplication.getConfig();.

@graemerocher
Copy link
Member

Really the dialect setting is better in the hibernate section so I see no reason to fix this, other than updating the docs

@graemerocher
Copy link
Member

On second thought no, this is better under the data source as you may need to configure different dialects for multiple data sources

@squarepegsys
Copy link

So you cannot declare multiple Hibernate dialects using in the hibernate section?

@graemerocher
Copy link
Member

You can, but you also need the ability to declare a different dialect per data source

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants