【问题标题】:Connection reset SQLException with jetty使用码头连接重置 SQLException
【发布时间】:2010-05-20 15:43:09
【问题描述】:

我已经将我的网络服务器从 tomcat 切换到 jetty,并在从空闲时间回来时遇到“java.sql.SQLException:Io 异常:连接重置”(例如,我出去了一会儿):(

当我使用 tomcat 时不会出现此问题。它是来自码头还是我做错了什么?

这是我的数据源配置

<bean id="dataSourceOracle" class="com.mchange.v2.c3p0.ComboPooledDataSource">
  <property name="driverClass" value="oracle.jdbc.driver.OracleDriver"></property>
  <property name="jdbcUrl" value="jdbc:oracle:thin:@127.0.0.1:1521:ORCL"/>
  <property name="user" value="admin"/>
  <property name="password" value="123"/>
  <property name="initialPoolSize" value="0"></property>
  <property name="minPoolSize" value="0"></property>
  <property name="maxPoolSize" value="100"/>
 </bean>

<bean id="hibernateSessionFactory2" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
  <property name="dataSource" ref="dataSourceOracle"/>
  <property name="mappingLocations">
   <list>
    <value>classpath:hibernate/mapping/User.hbm.xml</value>
    <value>classpath:hibernate/mapping/Address.hbm.xml</value>
    <value>classpath:hibernate/mapping/Province.hbm.xml</value>
    <value>classpath:hibernate/mapping/Service.hbm.xml</value>
    <value>classpath:hibernate/mapping/AccessLog.hbm.xml</value>
   </list>
  </property>
  <property name="hibernateProperties">
      <value>
       hibernate.connection.shutdown=false
       hibernate.show_sql=true
       hibernate.dialect=org.hibernate.dialect.Oracle10gDialect
      </value>
     </property>
 </bean>

谢谢!

【问题讨论】:

    标签: java hibernate spring jdbc jetty


    【解决方案1】:

    它是否在数据源定义中使用不同的连接设置/池?

    【讨论】:

      【解决方案2】:

      我已经切换到bonecp,它通过默认的bonecp 配置解决了:)

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2022-01-20
        • 2013-07-21
        • 2017-08-16
        • 2018-03-11
        • 2013-08-15
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多