您的位置:首页 > 其它

渗透工具nmap使用教程

2014-04-14 16:37 423 查看
hibernate spring-mvc集成:

错误说明:

通过junit测试dao时,报错:createQuery is not valid without active transaction,错误为没有有效的事物,即session中没有关联事物。

问题分析:

openSession()与getCurrentSession()区别,

参考:http://zhou137520.iteye.com/blog/1630656

解决办法:

1、手动添加事物管理,即Transaction tx = session.beginTransaction();.....tx.commit();

2、session = sessionFactory.getSession();

个人看法:

进行测试时使用openSession(),在web上运行时采用getCurrentSession()。

 
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: