hibernate如果要使用getCurrentSession

Posted 轻语

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了hibernate如果要使用getCurrentSession相关的知识,希望对你有一定的参考价值。

* 如果使用的是本地事务(jdbc事务)
 <property name="hibernate.current_session_context_class">thread</property>
 * 如果使用的是全局事务(jta事务)
 <property name="hibernate.current_session_context_class">jta</property> 

此时无论是DML还是DQL都需要事务。




以上是关于hibernate如果要使用getCurrentSession的主要内容,如果未能解决你的问题,请参考以下文章