diff --git a/modules/dbsupport/src/main/java/org/jpos/ee/DB.java b/modules/dbsupport/src/main/java/org/jpos/ee/DB.java index 64c5b8c563..88c12e5ad9 100644 --- a/modules/dbsupport/src/main/java/org/jpos/ee/DB.java +++ b/modules/dbsupport/src/main/java/org/jpos/ee/DB.java @@ -170,6 +170,11 @@ public Dialect getDialect() { } public static synchronized void invalidateSessionFactories() { + for (SessionFactory sf : sessionFactories.values()) { + try { + sf.close(); + } catch (Exception ignored) {} + } sessionFactories.clear(); }