-
Notifications
You must be signed in to change notification settings - Fork 0
지찬우 6주차 학습 정리
지찬우 edited this page Aug 12, 2024
·
1 revision
HikariDataSource의 close()를 호출해 반환해 주어야 함.
ServletContextListener를 상속받는 ApplicationConfiguration에서 contextDestroyed() 오버라이딩 하여 닫아주기
@WebListener
public class ApplicationConfiguration implements ServletContextListener {
...
@@Override
public void contextDestroyed(ServletContextEvent sce) {
JdbcTemplate jdbcTemplate = InstanceFactory.jdbcTemplate();
jdbcTemplate.shutdownConnectionPool();
}
}