首页 > 数据库技术 > 详细

Manual close is not allowed over a Spring managed SqlSession

时间:2015-07-12 21:49:11      阅读:2268      评论:0      收藏:0      [点我收藏+]

Manual close is not allowed over a Spring managed SqlSession

整合spring与MyBatis时出现如下警告: 
[org.springframework.beans.factory.support.DisposableBeanAdapter.invokeCustomDestroyMethod(DisposableBeanAdapter.java:360)]-[WARN] Invocation of destroy method ‘close‘ failed on bean with name ‘sqlSession‘: java.lang.UnsupportedOperationException: Manual close is not allowed over a Spring managed SqlSession 
网上搜了一下,要去掉警告要在org.mybatis.spring.SqlSessionTemplate上加上 
<bean id="sqlSession" class="org.mybatis.spring.SqlSessionTemplate" scope="prototype">  

       <constructor-arg ref="sqlSessionFactory" />  

</bean>  


Manual close is not allowed over a Spring managed SqlSession

原文:http://xuchenguang.blog.51cto.com/730272/1673434

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!