当前位置:Gxlcms > 数据库问题 > Manual close is not allowed over a Spring managed SqlSession

Manual close is not allowed over a Spring managed SqlSession

时间:2021-07-01 10:21:17 帮助过:24人阅读


[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

标签:spring   mybatis   

人气教程排行