Broken Pipe Exception on Grails App

后端 未结 2 1134
广开言路
广开言路 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:20

    With the solutions that were presented here my application was always getting a broken pipe exception. I created a webservice with a script the runs every hour, that way the application never loses its connection to the database. Since then the exception was never been thrown again. Thank you all for your answers anyway :)

    0 讨论(0)
  • 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

    0 讨论(0)
提交回复
热议问题