2
我想上传图片(逐个)使用c3p0连接池,但我的jdbc类型4驱动程序(连接到MySQL)不断关闭连接。我已经看到mysql配置中的最大超时设置为300秒。这是我的持久性xml如何使用c3p0。连接关闭后,不允许任何操作。连接被驱动程序隐式关闭。 C3P0
<bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource"
scope="singleton" destroy-method="close">
<property name="driverClass" value="...." />
<property name="jdbcUrl" value="...." />
<property name="user" value="....." />
<property name="password" value="...." />
<property name="initialPoolSize" value="10" />
<property name="minPoolSize" value="5" />
<property name="maxPoolSize" value="20" />
<property name="maxIdleTime" value="5" />
<property name="autoCommitOnClose" value="false" />
</bean>
有人可以解释究竟是什么导致驱动程序隐式关闭连接。 另外,我该如何解决这个问题?
以下是错误消息我得到:
19:01:45,504 WARN NewPooledConnection:486 - [c3p0] A PooledConnection that has already signalled a Connection error is still in use!
19:01:45,505 WARN NewPooledConnection:487 - [c3p0] Another error has occurred [
com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: No operations allowed after connection closed.Connection was implicitly closed by the driver. ] which will not be reported to listeners!
com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: No operations allowed after connection closed.Connection was implicitly closed by the driver.
我认为这个问题是更多的[超级用户](http://www.superuser.com )。 – PlasmaPower
@PlasmaPower,它几乎属于这里。 – Reddy
@Reddy这是关于驱动程序,这里唯一的代码是XML。 [帮助中心](http://stackoverflow.com/help/on-topic)表示,问题应该是:特定的**编程**问题(否),软件算法(否),常用软件工具由程序员(类似的,但这是一个驱动程序错误),或实际的,可回答的问题,这是**软件**开发(否)所特有的。 [超级用户的帮助中心](http://superuser.com/help/on-topic)表示问题应该是:计算机硬件,计算机软件(适用于此)或个人和家庭计算机网络。 – PlasmaPower