摘要: 阅读全文
posted @ 2018-05-16 16:42 傲云萧雨 阅读(694) 评论(0) 推荐(0) 编辑
摘要: Session session=null; try { session=factory.openSession(); //将事务设置为活动状态,但并不表示这会开启一个事务,事务是一直存在的。 tx=session.beginTransaction(); //操作A id= (int) session 阅读全文
posted @ 2018-05-16 16:24 傲云萧雨 阅读(99) 评论(0) 推荐(0) 编辑
摘要: * 如果使用的是本地事务(jdbc事务) <property name="hibernate.current_session_context_class">thread</property> * 如果使用的是全局事务(jta事务) <property name="hibernate.current_ 阅读全文
posted @ 2018-05-16 15:46 傲云萧雨 阅读(342) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2018-05-16 15:35 傲云萧雨 阅读(244) 评论(0) 推荐(0) 编辑