0

我正在使用弹簧和休眠应用程序。我正在使用 C3P0 连接池连接到 oracle 数据库。但我经常低于例外。

Database failure Exception 
java.net.SocketTimeoutException: Read timed out
    at java.net.SocketInputStream.socketRead0(Native Method)
    at java.net.SocketInputStream.read(Unknown Source)
    at org.apache.coyote.http11.InternalInputBuffer.fill(InternalInputBuffer.java:746)
    at org.apache.coyote.http11.InternalInputBuffer$InputStreamInputBuffer.doRead(InternalInputBuffer.java:776)

它与C3P0配置有关吗?以下是 c3p0 配置:

<bean id="someDataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource">
            <property name="driverClass" value="${driverClassName}" />
            <property name="jdbcUrl" value="${url}" />
            <property name="user" value="${username}" />
            <property name="password" value="${password}" />
            <!-- pool sizing -->
        <property name="initialPoolSize" value="3" />
        <property name="minPoolSize" value="6" />
        <property name="maxPoolSize" value="25" />
        <property name="acquireIncrement" value="3" />
        <property name="maxStatements" value="${common.db.max.statements}" />
        <!-- retries -->
        <property name="acquireRetryAttempts" value="1" />
        <property name="acquireRetryDelay" value="1000" /> <!-- 1s -->

            <property name="preferredTestQuery" value="select sysdate from dual" />
      </bean>

谢谢!

4

1 回答 1

0

有一些查询花费了太多时间来返回响应。异常跟踪似乎是异常响应的最终堆栈。

如果您捕获异常响应的“causedBy”跟踪,您将能够查明占用大量执行时间的确切代码逻辑。

希望这可以帮助!

于 2013-01-28T15:17:39.850 回答