我总是遇到同样的例外,我已经尽我所能通过搜索来获得解决方案,但没有任何好处。
我的例外是:
SEVERE: Exception : org.apache.tomcat.jdbc.pool.PoolExhaustedException: [pool-2-thread-1] Timeout: Pool empty. Unable to fetch a connection in 30 seconds, none available[size:100; busy:100; idle:0; lastwait:30000].
at org.apache.tomcat.jdbc.pool.ConnectionPool.borrowConnection(ConnectionPool.java:672)
at org.apache.tomcat.jdbc.pool.ConnectionPool.getConnection(ConnectionPool.java:187)
at org.apache.tomcat.jdbc.pool.DataSourceProxy.getConnection(DataSourceProxy.java:128)
at com.xxxxx.dbmanager.utils.DBManager.getConnection(DBManager.java:81)
at com.xxxxx.dbmanager.utils.SQLManager.<init>(SQLManager.java:36)
at ...
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:351)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:178)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:178)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
我试图增加 mysql DB 中的最大连接数。
我只是想知道在后台运行并创建线程的 servlet 是否可能是问题所在?任务完成后如何杀死我的线程?
感谢您的帮助!