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

getCurrentSession 与 openSession() 的差异

2012-09-23 
getCurrentSession 与 openSession() 的区别1 getCurrentSession创建的session会和绑定到当前线程,而openS

getCurrentSession 与 openSession() 的区别

1 getCurrentSession创建的session会和绑定到当前线程,而openSession不会。

2 getCurrentSession创建的线程会在事务回滚或事物提交后自动关闭,而openSession必须手动关闭

这里getCurrentSession本地事务(本地事务:jdbc)时 要在配置文件里进行如下设置

* 如果使用的是本地事务(jdbc事务)

?

?

?

本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/LoveYouT/archive/2009/05/17/4193894.aspx

热点排行