Skip to content

Commit

Permalink
actually we need per-session dialect
Browse files Browse the repository at this point in the history
  • Loading branch information
ar committed Sep 9, 2019
1 parent ce5a893 commit aaa6048
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions modules/dbsupport/src/main/java/org/jpos/ee/DB.java
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,9 @@ public SessionFactory getSessionFactory() {
sf = sessionFactories.get(cm);
if (sf == null)
sessionFactories.put(cm, sf = newSessionFactory());
if (sf instanceof SessionFactoryImpl) {
dialect = ((SessionFactoryImpl) sf).getJdbcServices().getDialect();
}
} catch (IOException | ConfigurationException | DocumentException | InterruptedException e) {
throw new RuntimeException("Could not configure session factory", e);
} finally {
Expand All @@ -167,11 +170,7 @@ private SessionFactory newSessionFactory() throws IOException, ConfigurationExce
Metadata md = getMetadata();
try {
newSessionSem.acquireUninterruptibly();
SessionFactory sf = md.buildSessionFactory();
if (sf instanceof SessionFactoryImpl) {
dialect = ((SessionFactoryImpl) sf).getJdbcServices().getDialect();
}
return sf;
return md.buildSessionFactory();
} finally {
newSessionSem.release();
}
Expand Down

0 comments on commit aaa6048

Please # to comment.