tomcat让人头疼的问题,救命啊!!!

dongjin86 2011-08-19 04:27:10
SSH做的一个项目,前台查询数据并分页显示,前几次可以正常显示数据,大概点击查询同一个表5次以后网页就没有反应了,页面一直处于等待状态。。。等把Tomcat重启之后又可以运行,不过只能访问那么几次就不行了。为什么啊。后台上没有发出sql语句,只是显示
WARN org.apache.struts2.components.ServletUrlRenderer:56 - No configuration found for the specified action: '/search_getAd.action' in namespace: '/searchCenter'. Form action defaulting to 'action' attribute's literal value.
另外,我再后台管理页面也有查询功能,可以没有限制的查询出数据并分页显示。
...全文
221 11 打赏 收藏 转发到动态 举报
写回复
用AI写文章
11 条回复
切换为时间正序
请发表友善的回复…
发表回复
彩票虫虫 2011-08-19
  • 打赏
  • 举报
回复
这就是传说中的如花大哥啊呵呵。
ypfei2008 2011-08-19
  • 打赏
  • 举报
回复
6楼的头像和楼主产生的鲜明对比...果然美女都是要对比才能看出美来的
liuyuhua0066 2011-08-19
  • 打赏
  • 举报
回复
亲,让我叫你一声如花吧!
[Quote=引用 7 楼 dongjin86 的回复:]
引用 6 楼 gavin_ts 的回复:

LZ的头像 让我无意看问题!!!!

兄弟的回答让我很惭愧。
[/Quote]
songzhd 2011-08-19
  • 打赏
  • 举报
回复
木有关闭数据库连接。。。。。
dongjin86 2011-08-19
  • 打赏
  • 举报
回复
[Quote=引用 6 楼 gavin_ts 的回复:]

LZ的头像 让我无意看问题!!!!
[/Quote]
兄弟的回答让我很惭愧。
我嘞个去 2011-08-19
  • 打赏
  • 举报
回复
LZ的头像 让我无意看问题!!!!
dongjin86 2011-08-19
  • 打赏
  • 举报
回复
[Quote=引用 4 楼 zn85600301 的回复:]

有没有将事务控制加上 否则不会主动释放链接
[/Quote]

哈哈,谢谢了疏忽了。在里面手动关闭session没问题吧?
zn85600301 2011-08-19
  • 打赏
  • 举报
回复
有没有将事务控制加上 否则不会主动释放链接
dongjin86 2011-08-19
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 liuyuhua0066 的回复:]

如花,hibernate.connection.release_mode配置的是什么?
[/Quote]

我的dao层是这么写的


public List getArchiveDescriptionByInstance(ArchiveDescription ad) {

Criteria crit = this.hibernateTemplate.getSessionFactory().openSession().createCriteria(ad.getClass());;

Criterion filing_year = null,maintitle = null,sbt_word = null,ufld0002 = null;

Conjunction conjunction = Restrictions.conjunction();// 合取

try {
if (ad.getFiling_year()!= null){
if (!ad.getFiling_year().equals(null)){
filing_year = Restrictions.like("filing_year", ad.getFiling_year());
conjunction.add(filing_year);
}
}
if (ad.getSbt_word()!= null){
if (!ad.getSbt_word().equals(null)){
sbt_word = Restrictions.like("sbt_word", "%" + ad.getSbt_word() + "%");
conjunction.add(sbt_word);
}
}
if (ad.getMaintitle() != null){
if (!ad.getMaintitle().equals(null)){
maintitle = Restrictions.like("maintitle", "%" + ad.getMaintitle() + "%");
conjunction.add(maintitle);
}
}
ufld0002 = Restrictions.eq("ufld0002", "开放");

conjunction.add(ufld0002);

crit.add(conjunction);


} catch (HibernateException e) {
e.printStackTrace();
}
return crit.list();
}


好像是session没有管理,在这里怎么关不啊?
zslqw 2011-08-19
  • 打赏
  • 举报
回复
应该是配置出问题了
liuyuhua0066 2011-08-19
  • 打赏
  • 举报
回复
如花,hibernate.connection.release_mode配置的是什么?

81,092

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧