首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 软件管理 > 软件架构设计 >

Spring测试中Hiberante session缓存有关问题

2012-11-04 
Spring测试中Hiberante session缓存问题测试很关键..没有测试的代码是遗留代码...Spring给测试提供了好多

Spring测试中Hiberante session缓存问题
测试很关键..没有测试的代码是遗留代码...

Spring给测试提供了好多方便之处.

protected void flushSession();{ SessionFactory sessionFactory = (SessionFactory)applicationContext.getBean("sessionFactory"); sessionFactory.getCurrentSession().flush();sessionFactory.getCurrentSession().clear(); }

在测试方法中,如果要查询已查询过的数据,可以在查询之前用调用下这个方法..

热点排行