File tree Expand file tree Collapse file tree
Kitodo/src/main/java/org/kitodo/production Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3131import org .apache .logging .log4j .Logger ;
3232import org .kitodo .config .ConfigCore ;
3333import org .kitodo .config .enums .ParameterCore ;
34+ import org .kitodo .data .database .persistence .HibernateUtil ;
3435import org .kitodo .production .helper .tasks .TaskManager ;
3536import org .kitodo .production .interfaces .activemq .ActiveMQDirector ;
3637import org .kitodo .production .security .SecurityUserDetails ;
@@ -118,6 +119,10 @@ public void contextDestroyed(ServletContextEvent sce) {
118119 if (Objects .nonNull (activeMQDirector )) {
119120 activeMQDirector .shutDown ();
120121 }
122+
123+ // close connection to database on shutdown.
124+ // must be adjusted on switching to JPA or another connection layer.
125+ HibernateUtil .getSession ().getSessionFactory ().close ();
121126 }
122127
123128 @ Override
You can’t perform that action at this time.
0 commit comments