2011年8月29日
摘要: 1 getCurrentSession创建的session会和绑定到当前线程,而openSession不会。2 getCurrentSession创建的线程会在事务回滚或事物提交后自动关闭,而openSession必须手动关闭这里getCurrentSession本地事务(本地事务:jdbc)时 要在配置文件里进行如下设置 * 如果使用的是本地事务(jdbc事务)<property name="hibernate.current_session_context_class">thread</property> * 如果使用的是全局事务(jta事务)& 阅读全文
posted @ 2011-08-29 01:15 星^_^風 阅读(159) 评论(0) 推荐(0) 编辑