zoukankan      html  css  js  c++  java
  • Software caused connection abort: socket write error


    57151609 [http-80-21] WARN org.hibernate.util.JDBCExceptionReporter - SQL Error: 0, SQLState: 08S01

    57151609 [http-80-21] ERROR org.hibernate.util.JDBCExceptionReporter - Communications link failure due to underlying exception:

    ** BEGIN NESTED EXCEPTION **

    java.net.SocketException

    MESSAGE: Software caused connection abort: socket write error

    STACKTRACE:

    java.net.SocketException: Software caused connection abort: socket write error


    Mysql connection timeout is 8 hours,or connection will close.


    We can use c3p0 to resolve this error.


    Modify the hibernate.cfg.xml like this:


    <property name="hibernate.connection.provider_class">org.hibernate.connection.C3P0ConnectionProvider</property>& amp;amp; lt;br /> <property name="hibernate.c3p0.min_size">8</property>
    <property name="hibernate.c3p0.max_size">200</property>
    <property name="hibernate.c3p0.timeout">600</property>
    <property name="hibernate.c3p0.max_statements">0</property>
    <property name="hibernate.c3p0.idle_test_period">60</property>
    <property name="hibernate.c3p0.acquire_increment">2</property>
    <property name="hibernate.c3p0.validate">true</property>


    You should also add

    hibernate3.jar

    c3p0-0.9.1.jar





  • 相关阅读:
    App性能测试工具-PerfDog
    痛并快乐着
    SQLyog连接MySQL的前前后后
    组合模式
    Java并发编程:线程池的使用
    高效能人事的七个习惯
    Spring中Bean的生命周期及其扩展点
    (转)第一次有人把“分布式事务”讲的这么简单明了
    分布式事物
    mybatis学习笔记(2)基本原理
  • 原文地址:https://www.cnblogs.com/liuzhengdao/p/1579852.html
Copyright © 2011-2022 走看看