论坛首页 编程语言技术论坛

org.hibernate.HibernateException: No Session found for current thread

浏览 7028 次
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
作者 正文
   发表时间:2012-04-01  

Spring3.1.1 Intergrate with Hibernate 4.0.1 occurs the

 

org.hibernate.HibernateException: No Session found for current thread

 

In the applicationContext.xml configuration:

 

this configuration should like this

 

<tx:advice id="txAdvice" transaction-manager="txManager">
		<tx:attributes>
			<tx:method name="get*" read-only="true" propagation="REQUIRED"/>
			<tx:method name="*" propagation="REQUIRED"/>
		</tx:attributes>
</tx:advice>

 

it seems that propagation set values[SUPPORTS|NOT_SUPPORTED|NEVER] will issue

 

No Session found for the current thread

   发表时间:2012-04-11  
你这是求解还是干嘛?没看明白,这个错误很明显了,没有找到session在当前的线程中。你贴事务的东西干嘛呢?
0 请登录后投票
   发表时间:2012-04-12  
估计他延时加载了。。。 然后页面又取从表值 so。。。
0 请登录后投票
   发表时间:2012-04-14  
你可能在aop上出了点问题
0 请登录后投票
   发表时间:2012-04-18  
我之前有个很愚蠢的错误,就是初始化了两次spring context,然后就报这个错误,当前线程没有session。。。。。。
0 请登录后投票
   发表时间:2012-04-20  
用 quartz时 经常出现这个问题
0 请登录后投票
论坛首页 编程语言技术版

跳转论坛:
Global site tag (gtag.js) - Google Analytics