[Spring] Mybatis의 RefreshableSqlSessionFactoryBean의 SQL 수정이 반영되지 않을 때
Java
2025. 3. 24. 14:26
결론부터 말씀드리면 이 MybatisProperties의 Configuration에서 로드된 자원 필드인 loadedResources값을 삭제해주면 됩니다.하지만 이 필드는 보시는 바와 같이 protected final로 선언되어 있고 set 메소드도 따로 존재하지 않습니다. 따라서 기존의 refresh 메서드에 Spring에서 제공하는 BeanUtils를 사용해 깊은 복사로 새로운 객체를 만들어 해결했습니다. /** * @throws Exception */ public void refresh() throws Exception { if (log.isInfoEnabled()) { log.info("refreshing sqlMapClient."); ..