Grails 2.4 and hibernate4 errors with run-app

前端 未结 3 970
感情败类
感情败类 2020-11-29 07:35

I\'ve upgraded an app to Grails 2.4.0, and I\'m using the hibernate4 plugin. When executing run-app the error examples below are generated for each domain class using the in

3条回答
  •  迷失自我
    2020-11-29 08:16

    Just set dbCreate="update", and the errors go away immediately.

    The problem is that GORM (hibernate) is trying to drop tables in the H2 DB that have never been created because the DB is created new each time you run the app. Unfortunately, dbCreate is set to create-drop by default, which really doesn't make sense for a database that is created on the fly at runtime.

    development {
        dataSource {
            dbCreate = "update" // one of 'create', 'create-drop', 'update', 'validate', ''
            url = "jdbc:h2:mem:devDb;MVCC=TRUE;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE"
        }
    

提交回复
热议问题