Ben W.
Ben W.

Reputation: 401

Unable to override global version in Grails 6

In the process of upgrading from Grails 3 to Grails 6, I am getting different behavior in bootRun vs. war deployments.

This setting in conf/application.groovy is set to disable the version (optimistic locking feature):

grails.gorm.default.mapping = { version false autoTimestamp false autowire true }

It works find in local ./gradlew bootRun but throws exception due to missing version columns if run from a WAR file.

I have tried setting this in application.yml as well as relocating application.groovy from conf to src/main/resources but the problem persists. The only workaround I've found is setting it in each domain class mapping closure, but that's not an ideal solution as we have several hundred domain objects.

Help sincerely appreciated. Thanks in advance.

Upvotes: 2

Views: 74

Answers (1)

John Lear
John Lear

Reputation: 86

I'm using Grails 4 as I haven't got to 6 yet, but bootRun utilizes the 'development' Grails environment by default. A war file will use the 'production' Grails environment.

I would check your datasource definitions to make sure they are configured appropriately.

Upvotes: 0

Related Questions