posts - 68, comments - 19, trackbacks - 0, articles - 1

出现mysql超时的问题

Posted on 2011-02-05 15:00 viery 阅读(145) 评论(0)  编辑  收藏
使用tomcat默认配置在项目中出现超过1天以上mysql jdbc超时的问题,暂时找到改变配置池来解决,效果如何还要看这几天的测试。
具体配置:

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
          "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
          "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">

<!-- Generated by MyEclipse Hibernate Tools.                   -->
<hibernate-configuration>

 <session-factory>
  <property name="show_sql">true</property>
  <property name="dialect">
   org.hibernate.dialect.MySQLDialect
  </property>
  <property name="connection.url">jdbc:mysql://localhost:3306/test</property>
  <property name="connection.username">root</property>
  <property name="connection.password">123456</property>
  <property name="connection.driver_class">com.mysql.jdbc.Driver</property>
  <property name="myeclipse.connection.profile">test</property>
  <!-- c3p0的配置 -->
  <property name="connection.provider_class">
    org.hibernate.connection.C3P0ConnectionProvider
  </property>
  <property name="c3p0.min_size">5</property>
  <property name="c3p0.max_size">20</property>
  <property name="c3p0.timeout">1800</property>
  <property name="c3p0.idle_test_period">120</property>
  <property name="c3p0.acquire_increment">30</property>
  <property name="c3p0.max_statements">50</property>
  <mapping resource="com/entity/Operation.hbm.xml" />
 </session-factory>

</hibernate-configuration>


只有注册用户登录后才能发表评论。


网站导航: