Skip to content

Commit

Permalink
Merge pull request #226 from bmomcilov/bugfix/db-graceful-shutdown-su…
Browse files Browse the repository at this point in the history
…pport

Close session factories on DB.invalidateSessionFactories()
  • Loading branch information
ar authored Oct 6, 2021
2 parents 7453132 + 15bfff3 commit 2b26d0e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions modules/dbsupport/src/main/java/org/jpos/ee/DB.java
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down

0 comments on commit 2b26d0e

Please # to comment.