Home (WARN) Invocation of destroy method 'close' failed on bean with name 'sqlSession'
Post
Cancel

(WARN) Invocation of destroy method 'close' failed on bean with name 'sqlSession'

1. 내용


1
2
3
4
WARN : org.springframework.beans.factory.support.DisposableBeanAdapter - 
Invocation of destroy method 'close' failed on bean with name 'sqlSession': 
java.lang.UnsupportedOperationException: 
Manual close is not allowed over a Spring managed SqlSession

2. 해결


1
2
3
4
5
6
'SqlSession' bean에 destroy-method="clearCache"를 추가해준다.

■ 아래 소스 참고
<bean id="sqlSession" class="org.mybatis.spring.SqlSessionTemplate" destroy-method="clearCache">
  <constructor-arg name="sqlSessionFactory" ref="sqlSessionFactory" />		
</bean>
This post is licensed under CC BY 4.0 by the author.