![](https://img-blog.csdnimg.cn/20201014180756913.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
hibernate
lvjun0565
年轻就是付出,就是收获。。。
展开
-
SSH中使用getCurrentSession()获得session
SSH中使用getCurrentSession()获得session 在hibernate的配置文件中增加属性:thread如下表红色部分 root jdbc:mysql://localhost:3306/dbtest org.hibernate.dialect.MySQLDialect转载 2009-05-31 14:09:00 · 7777 阅读 · 1 评论 -
SessionFactory.getCurrentSession与openSession的区别
原来在做jbpm工作流时老是出现session的问题出现异常,算是办法也简单session.close(),原因是我在sevice层openSession而忘记关闭,每写一个方法都必须这样。而采用getCurrentSession的话就不需要了,现总结两者间的区别:1. 如果使用的是getCurrentSession来创建session的话,在commit后,session转载 2009-05-30 16:12:00 · 8395 阅读 · 0 评论