JDBC+C3P0 处理数据一段时间后挂掉!求解?!

发布于 2021-11-26 23:29:14 字数 8845 浏览 781 评论 2

oracle+jdbc+c3p0+批处理

就这么点东西,简单从excel读取数据插入到数据库,大概有40几万吧

但是执行了一会后就挂掉了,网上说要增大数据库的连接数,还是不解,请大家给我出出主意怎么处理。

c3p0基本配置:

<c3p0-config>
		<default-config>
				<property name="user">cognos</property>
				<property name="password">aixsdcnc</property>
				<property name="driverClass">oracle.jdbc.driver.OracleDriver</property>
				<property name="jdbcUrl">jdbc:oracle:thin:@IP:1521:cognos</property>
				<property name="initialPoolSize">10</property>
				<property name="maxIdleTime">30</property>
				<property name="maxPoolSize">20</property>
				<property name="minPoolSize">5</property>
		</default-config>
</c3p0-config>



异常:
六月 27, 2014 10:25:38 上午 com.mchange.v2.async.ThreadPoolAsynchronousRunner$DeadlockDetector run
WARNING: com.mchange.v2.async.ThreadPoolAsynchronousRunner$DeadlockDetector@122bfc2 -- APPARENT DEADLOCK!!! Creating emergency threads for unassigned pending tasks!
六月 27, 2014 10:25:38 上午 com.mchange.v2.async.ThreadPoolAsynchronousRunner$DeadlockDetector run
WARNING: com.mchange.v2.async.ThreadPoolAsynchronousRunner$DeadlockDetector@122bfc2 -- APPARENT DEADLOCK!!! Complete Status: 
	Managed Threads: 3
	Active Threads: 3
	Active Tasks: 
		com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@145e5ac (com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#2)
		com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@1e9a8e3 (com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#1)
		com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@14ef1ea (com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#0)
	Pending Tasks: 
		com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@1ec4abb
Pool thread stack traces:
	Thread[com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#2,5,main]
		java.net.SocketInputStream.socketRead0(Native Method)
		java.net.SocketInputStream.read(SocketInputStream.java:150)
		java.net.SocketInputStream.read(SocketInputStream.java:121)
		oracle.net.ns.Packet.receive(Unknown Source)
		oracle.net.ns.DataPacket.receive(Unknown Source)
		oracle.net.ns.NetInputStream.getNextPacket(Unknown Source)
		oracle.net.ns.NetInputStream.read(Unknown Source)
		oracle.net.ns.NetInputStream.read(Unknown Source)
		oracle.net.ns.NetInputStream.read(Unknown Source)
		oracle.jdbc.driver.T4CMAREngine.unmarshalUB1(T4CMAREngine.java:1104)
		oracle.jdbc.driver.T4CMAREngine.unmarshalSB1(T4CMAREngine.java:1075)
		oracle.jdbc.driver.T4CTTIoauthenticate.receiveOsesskey(T4CTTIoauthenticate.java:272)
		oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:357)
		oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:439)
		oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:165)
		oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:35)
		oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:801)
		com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:134)
		com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:182)
		com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:171)
		com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:137)
		com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1014)
		com.mchange.v2.resourcepool.BasicResourcePool.access$800(BasicResourcePool.java:32)
		com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask.run(BasicResourcePool.java:1810)
		com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547)
	Thread[com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#1,5,main]
		java.net.SocketInputStream.socketRead0(Native Method)
		java.net.SocketInputStream.read(SocketInputStream.java:150)
		java.net.SocketInputStream.read(SocketInputStream.java:121)
		oracle.net.ns.Packet.receive(Unknown Source)
		oracle.net.ns.DataPacket.receive(Unknown Source)
		oracle.net.ns.NetInputStream.getNextPacket(Unknown Source)
		oracle.net.ns.NetInputStream.read(Unknown Source)
		oracle.net.ns.NetInputStream.read(Unknown Source)
		oracle.net.ns.NetInputStream.read(Unknown Source)
		oracle.jdbc.driver.T4CMAREngine.unmarshalUB1(T4CMAREngine.java:1104)
		oracle.jdbc.driver.T4CMAREngine.unmarshalSB1(T4CMAREngine.java:1075)
		oracle.jdbc.driver.T4CTTIoauthenticate.receiveOsesskey(T4CTTIoauthenticate.java:272)
		oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:357)
		oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:439)
		oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:165)
		oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:35)
		oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:801)
		com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:134)
		com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:182)
		com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:171)
		com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:137)
		com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1014)
		com.mchange.v2.resourcepool.BasicResourcePool.access$800(BasicResourcePool.java:32)
		com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask.run(BasicResourcePool.java:1810)
		com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547)
	Thread[com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#0,5,main]
		java.net.SocketInputStream.socketRead0(Native Method)
		java.net.SocketInputStream.read(SocketInputStream.java:150)
		java.net.SocketInputStream.read(SocketInputStream.java:121)
		oracle.net.ns.Packet.receive(Unknown Source)
		oracle.net.ns.DataPacket.receive(Unknown Source)
		oracle.net.ns.NetInputStream.getNextPacket(Unknown Source)
		oracle.net.ns.NetInputStream.read(Unknown Source)
		oracle.net.ns.NetInputStream.read(Unknown Source)
		oracle.net.ns.NetInputStream.read(Unknown Source)
		oracle.jdbc.driver.T4CMAREngine.unmarshalUB1(T4CMAREngine.java:1104)
		oracle.jdbc.driver.T4CMAREngine.unmarshalSB1(T4CMAREngine.java:1075)
		oracle.jdbc.driver.T4CTTIoauthenticate.receiveOsesskey(T4CTTIoauthenticate.java:272)
		oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:357)
		oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:439)
		oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:165)
		oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:35)
		oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:801)
		com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:134)
		com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:182)
		com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:171)
		com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:137)
		com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1014)
		com.mchange.v2.resourcepool.BasicResourcePool.access$800(BasicResourcePool.java:32)
		com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask.run(BasicResourcePool.java:1810)
		com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547)
六月 27, 2014 10:26:53 上午 com.mchange.v2.async.ThreadPoolAsynchronousRunner processReplacedThreads
WARNING: Task com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@145e5ac (in deadlocked PoolThread) failed to complete in maximum time 60000ms. Trying interrupt().
六月 27, 2014 10:26:53 上午 com.mchange.v2.async.ThreadPoolAsynchronousRunner processReplacedThreads
WARNING: Task com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@1e9a8e3 (in deadlocked PoolThread) failed to complete in maximum time 60000ms. Trying interrupt().
六月 27, 2014 10:26:53 上午 com.mchange.v2.async.ThreadPoolAsynchronousRunner processReplacedThreads
WARNING: Task com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@14ef1ea (in deadlocked PoolThread) failed to complete in maximum time 60000ms. Trying interrupt().



如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

不再见 2021-11-28 04:02:42

说的是Tomcat jdbc pool吧 没用过,不过可以了解一下

躲猫猫 2021-11-28 01:44:33

换tomcat7的新连接池吧

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文