We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 82fdef9 + 3e631fd commit ccffc1aCopy full SHA for ccffc1a
Kitodo/src/main/java/org/kitodo/production/version/KitodoVersionListener.java
@@ -21,6 +21,8 @@
21
import javax.servlet.ServletContextListener;
22
import javax.servlet.annotation.WebListener;
23
24
+import org.kitodo.data.database.persistence.HibernateUtil;
25
+
26
/**
27
* Listener to set up Kitodo versioning information from Manifest on application
28
* startup.
@@ -46,6 +48,8 @@ public void contextInitialized(ServletContextEvent sce) {
46
48
47
49
@Override
50
public void contextDestroyed(ServletContextEvent sce) {
- // nothing is done here
51
+ // close connection to database on shutdown.
52
+ // must be adjusted on switching to JPA or another connection layer.
53
+ HibernateUtil.getSession().getSessionFactory().close();
54
}
55
0 commit comments