一个SQLException被激发,java.lang.InterruptedException,我是用完了db连接? [英] An SQLException was provoked, java.lang.InterruptedException, am I running out of db connections?

查看:1364
本文介绍了一个SQLException被激发,java.lang.InterruptedException,我是用完了db连接?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此我们运行一个Hibernate,Spring,Spring Webflow堆栈。从我到目前为止阅读的内容来看,也许我们知道我们使用c3p0-0.9.1.2。



在过去的几天里,我们注意到服务器突然停止。用户不能登录网站,没有什么似乎发生,浏览器只是坐在加载页面永远。



当我们注意到我们关闭了tomcat实例,突然有一些下面的错误被记录;

  13:05:57.492 [TP-Processor7] WARN ohutil.JDBCExceptionReporter  -  SQL错误:0,SQLState:null 
13: 05:57.492 [TP-Processor7] ERROR ohutil.JDBCExceptionReporter - 由以下失败引发SQLException:java.lang.InterruptedException

任何想法这些是什么意思? Google没有太多的帮助。我们是否在某处泄露db连接,并且该池不能获得新的会话?



我们刚刚投入了一些新的Spring Webflow流,并且经历了稍微增加的网站数量。

解决方案

我怀疑这些 InterruptExceptions 来自于容器对这些线程的实际关闭,并且简单地表明当Tomcat关闭时这些线程是存在的。



相反,我会抓住一个<来自Tomcat的a href =http://expertodev.wordpress.com/2009/05/30/how-to-take-java-thread-dump/ =nofollow>线程转储冻结。我也会得到一个DBA来告诉你在数据库中发生了什么。从上面的内容我猜你挂在数据库资源上,但是从DBA的线程转储和分析肯定会指向正确的方向。



这里 Thread Dump JSP 作为生成线程转储的替代方法。


So we run a Hibernate, Spring, Spring Webflow stack. From what I've read so far it might also be important to know we use c3p0-0.9.1.2.

Over the last couple of days we've noticed the server suddenly stop. Users cannot log into the website, nothing appears to happen, the browser simply sits loading the page forever. The server logs also simply halt.

When we notice this we shutdown the tomcat instance and all of a sudden quite a few of the following errors get logged;

13:05:57.492 [TP-Processor7]   WARN  o.h.util.JDBCExceptionReporter - SQL Error: 0, SQLState: null
13:05:57.492 [TP-Processor7]   ERROR o.h.util.JDBCExceptionReporter - An SQLException was provoked by the following failure: java.lang.InterruptedException

Any ideas what these mean? Google hasn't been too helpful. Are we leaking db connections somewhere and the pool cannot gain a new session?

We have just put in a couple new Spring Webflow flows and are experiencing a slightly increased amount of website traffic but we haven't seen this behaviour before.

解决方案

I suspect those InterruptExceptions come from the actual shutdown of those threads by the container, and simply indicate that those threads are existant when Tomcat shuts down.

Instead, I would grab a thread dump from Tomcat when it next freezes. I would also get a DBA to tell you what's happening in the database. From the above I'm guessing you're hung on a database resource, but a thread dump and analysis from a DBA will certainly point you in the right direction.

Here's a Thread Dump JSP as an alternative means of generating thread dumps.

这篇关于一个SQLException被激发,java.lang.InterruptedException,我是用完了db连接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆