Broken Pipe Exception on Grails App

后端 未结 2 1135
广开言路
广开言路 2021-01-24 09:44

I developed an application on Grails 2.4.4 using jdk 1.7 and MySQL Workbench 6.3. It works for some time, but after some hours of the deployment i try to log in, it stops workin

2条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-24 10:35

    You need to c3p0 your project

    step :1

    Add this "BuildConfig.groovy"

    dependencies {
            // specify dependencies here under either 'build', 'compile'
    
            compile 'c3p0:c3p0:0.9.1.2'
        }
    

    step 2:

    Datasource groovy: Now your data source will be like this only remove the other things.

    beans {
        dataSource(BasicDataSource) {
            **url = "jdbc:mysql://127.0.0.1/db_name"**
            driverClassName = "com.mysql.jdbc.Driver"
            username = "root"
            password = "root"
            pooled = true
       }
    }
    

    For more info

    Do I need to use C3P0 pooling library in my (grails) web application?

    How do I configure c3p0 for a grails 2.X application with multiple datasources?.

    http://blog.nutpan.com/2013/07/grails-broken-pipe-and-cannot-release.html

    Thanks

提交回复
热议问题