1. 程式人生 > >報createSQLQuery is not valid without active transaction錯誤

報createSQLQuery is not valid without active transaction錯誤

建立一個ssh的專案之後,圖省事把原本的一個單hibernate的專案的hibernate.cfg.xml匯入了,誰知道遇到了一個賊噁心的問題,改了半天沒出來,結果在網上找到了一篇相關報錯,發現將hibernate和spring進行整合的時候不需要<!-- 在hibernate核心配置檔案中配置 -->         <!-- <property name="hibernate.current_session_context_class">thread</property> -->這一行了。