错误描述:java.sql.SQLException: Couldn't perform the operation setAutoCommit: You can't perform any operations on this connection. It has been automatically closed by Proxool for some reason (see logs).
at org.logicalcobwebs.proxool.WrappedConnection.invoke(WrappedConnection.java:207)
at org.logicalcobwebs.proxool.WrappedConnection.intercept(WrappedConnection.java:87)
at $java.sql.Connection$$EnhancerByProxool$$c663b102.setAutoCommit(<generated>)
at org.hibernate.transaction.JDBCTransaction.toggleAutoCommit(JDBCTransaction.java:224)
at org.hibernate.transaction.JDBCTransaction.commitAndResetAutoCommit(JDBCTransaction.java:169)
at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:142)
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1822)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
ERROR 2013-05-22 18:32:20,839 org.hibernate.transaction.JDBCTransaction: JDBC commit failed
java.sql.SQLException: Couldn't perform the operation commit: You can't perform any operations on this connection. It has been automatically closed by Proxool for some reason (see logs).
at org.logicalcobwebs.proxool.WrappedConnection.invoke(WrappedConnection.java:207)
at org.logicalcobwebs.proxool.WrappedConnection.intercept(WrappedConnection.java:87)
at $java.sql.Connection$$EnhancerByProxool$$c663b102.commit(<generated>)
at org.hibernate.transaction.JDBCTransaction.commitAndResetAutoCommit(JDBCTransaction.java:166)
at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:142)
at org.springframework.orm.hibernate3.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:656)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:754)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1822)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
解决方法:错误的意思是说,由于某些原因连接被Proxool自动关闭,出现这种情况,一般有如下原因:
1.可能为连接数据库超时,比如调试时,对一个窗口停留太久。(对Lucene建立的站内搜索时,俺就出现了这个错误~)
2.网上的说法:
<proxool.minimumConnectionCount>5</proxool.minimumConnectionCount>//最小连接数
<proxool.maximumConnectionCount>150</proxool.maximumConnectionCount>//最大连接数
<proxool.simultaneousBuildThrottle>20</proxool.simultaneousBuildThrottle>//同时最大连接数
连接数够用,但是同时最大连接数设置的小了点,取不到连接导致报错。
转载请标明: