Skip to content

Commit

Permalink
Set DB user and password read from Space in Properties
Browse files Browse the repository at this point in the history
This way other modules like Flyway that read these properties can find them. Without this, Flyway does not work if DB user and password are set using DBInstantiator.
  • Loading branch information
sumeetphadnis committed Aug 2, 2023
1 parent dc9da8f commit 779d1f1
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions modules/dbsupport/src/main/java/org/jpos/ee/DB.java
Original file line number Diff line number Diff line change
Expand Up @@ -569,10 +569,14 @@ private Metadata getMetadata() throws IOException, ConfigurationException, Docum
Space sp = SpaceFactory.getSpace("tspace:dbconfig");
String user = (String) sp.inp(dbPropertiesPrefix +"connection.username");
String pass = (String) sp.inp(dbPropertiesPrefix +"connection.password");
if (user != null)
if (user != null) {
ssrb.applySetting("hibernate.connection.username", user);
if (pass != null)
dbProps.setProperty("hibernate.connection.username", user);
}
if (pass != null) {
ssrb.applySetting("hibernate.connection.password", pass);
dbProps.setProperty("hibernate.connection.password", pass);
}
}
MetadataSources mds = new MetadataSources(ssrb.build());

Expand Down

0 comments on commit 779d1f1

Please sign in to comment.