渗透工具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()。
错误说明:
通过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()。
相关文章推荐
- 通过java反射获得属性名 和 值
- UVA10986
- 《TCP/IP详解卷1:协议》笔记--TCP紧急通知
- effective c++ 读书笔记
- ACM 心急的C小加
- 中国电子商务的十年发展历程(一)
- 一定要坚持每天写代码
- ubuntu 安装amqp扩展
- android之生命周期(二)onPause()、onResume()、onStop()详解:有实例
- CentOS Linux下VNC Server远程桌面配置详解
- LeetCode | Scramble String
- ORACLE游标实例讲解
- Longest Consecutive Sequence
- 全面了解TLC NAND技术以及市场现状
- hdu-4704 sum(费马小定理)
- 盘点2014年最赚钱的行业 你在其中吗?
- TinyXml快速入门
- Linux Shell sed(流编辑器)
- 关于 IOS 发布的点点滴滴记录(一)
- DAY18--java中你必须知道的23种经典模式开发Design Patterns