关于网友提出的“ 关于SSH的问题”问题疑问,本网通过在网上对“ 关于SSH的问题”有关的相关答案进行了整理,供用户进行参考,详细问题解答如下:
问题: 关于SSH的问题描述:
我用ssh做的一个小系统,做了几次查询动作,原先速度很快,可是后数据就出不来了?也不报错。要重启tomcat服务器才能继续查询数据库,请问这问题怎么解决?
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
<>class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
/>org.hibernate.dialect.MySQLDialect true <> true
update30
5
/>1800 50
3000
2
/> true
true
/>org.hibernate.cache.EhCacheProvider
com/weibo/model/User.hbm.xml
com/weibo/model/Group.hbm.xml
/>com/weibo/model/Weibo.hbm.xml com/weibo/model/Topic.hbm.xml
com/weibo/model/Transmit.hbm.xml com/weibo/model/Label.hbm.xml
com/weibo/model/Activity_Category.hbm.xml
com/weibo/model/Group_Category.hbm.xml com/weibo/model/Activity.hbm.xml
com/weibo/model/Message.hbm.xml
com/weibo/model/Activity_Message.hbm.xml com/weibo/model/User_Group.hbm.xml
com/weibo/model/User_Activity.hbm.xml com/weibo/model/Activity_Comment.hbm.xml com/weibo/model/Admin.hbm.xml com/weibo/model/Propaganda.hbm.xml
com/weibo/model/Love_Weibo.hbm.xml com/weibo/model/Weibo_Comment.hbm.xml com/weibo/model/Listen.hbm.xml
com/weibo/model/Comment_Message.hbm.xml com/weibo/model/User_Label.hbm.xml com/weibo/model/Weibo_Label.hbm.xml
解决方案1:
没有close();
解决方案2: 你这里面用了两种写法,第一种就属于自己获取了数据库连接:
List
List
sess.close();
}
检查下代码,是否有自己获取数据库连接的危险行为?从你描述现象来看,很像是数据库连接耗尽,也就是没有释放数据库连接所致。