我正在使用弹簧和休眠应用程序。我正在使用 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>
谢谢!