繁体   English   中英

Grails 更改为 MySQL 从 5.6 升级到 5.7

[英]Grails changes for MySQL upgrade from 5.6 to 5.7

我们是 grails 2.3.11 并且一直在使用 MySQL 5.6 (AWS RDS) 和 Hibernate

MySQL 和 hibernate 的现有运行时依赖项如下

dependencies {
        runtime 'mysql:mysql-connector-java:5.1.27'
...
...
...
plugins {
       runtime ":hibernate:3.6.10.19"

数据源配置如下。 (注意我们从来没有在这里设置方言)

dataSource {
    pooled = true
    jmxExport = true
    url = myjdbcURL
    driverClassName = "com.mysql.jdbc.Driver"
    username = myjdbcUserName
    password = myJdbcPassword
    properties {
        jmxEnabled = true
        initialSize = System.getenv("DB_INITIAL_SIZE")
        maxActive = System.getenv("DB_MAX_ACTIVE")
        minIdle = 5
        maxIdle = 25
        maxWait = 10000
        maxAge = 10 * 60000
        timeBetweenEvictionRunsMillis = 5000
        minEvictableIdleTimeMillis = 60000
        validationQuery = "SELECT 1"
        validationQueryTimeout = 3
        validationInterval = 15000
        testOnBorrow = true
        testWhileIdle = true
        testOnReturn = false
        ignoreExceptionOnPreLoad = true
        // http://tomcat.apache.org/tomcat-7.0-doc/jdbc-pool.html#JDBC_interceptors
        jdbcInterceptors = "ConnectionState;StatementCache(max=200)"
        defaultTransactionIsolation = java.sql.Connection.TRANSACTION_READ_COMMITTED // safe default
        // controls for leaked connections
        abandonWhenPercentageFull = 100 // settings are active only when pool is full
        removeAbandonedTimeout = 120
        removeAbandoned = true
        // use JMX console to change this setting at runtime
        logAbandoned = false // causes stacktrace recording overhead, use only for debugging
    }
}
hibernate {
    cache.use_second_level_cache = true
    cache.use_query_cache = false
    cache.region.factory_class = 'net.sf.ehcache.hibernate.EhCacheRegionFactory' // Hibernate 3
    show_sql = false
    format_sql = false
    use_sql_comments = false
}

现在我们正在寻找将 MySQL 升级到 5.7 并试图找到 grails 的任何文档,但找不到它。

我能看到的一件事是我们一直使用的 MySQL 连接器仅支持 5.6,因此第一步是将其更新为 mysql-connector-java:5.1.49,因为我看到这是最新版本,grails 是运行 jdk 7,我无法切换到连接器 8。

I couldnt find anything related to hibernate as the Hibernate gorm plugin that we have been using with grails is the only one I could find https://mvnrepository.com/artifact/org.grails.plugins/hibernate/3.6.10.19

最后,直到现在我们还没有为 MySQL 设置方言,所以不确定我们是否应该明确设置方言。

We are looking for least downtime, hence our plan was make Grails app support MySQL 5.7 first and keep backward compatibility with MySQL 5.6 and then upgrade MySQL to 5.7 and should still work.

有人做过这样的升级吗? 您的意见对我来说非常有价值。

我一直在通过 MySQL 连接器版本 5.1.45 使用 Grails 2.3.11 和 MySQL 5.7 的实例。 所以我想说你的一般方法应该很好,它是一个有效且有效的组合。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM