Skip to content

Commit

Permalink
- Context error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
Areeb-Gillani committed Sep 4, 2023
1 parent 0474563 commit f175ec9
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class ConnectionManager<T> {
private static final HashMap<String, Object> dbConnectionMap = new HashMap<>();

private static <T extends AbstractConnection> Object createDatabaseConnection(String connectionName){
JsonObject conf = Vertx.currentContext().config().getJsonObject("dbConnections").getJsonObject(connectionName);
JsonObject conf = Vertx.currentContext().owner().getOrCreateContext().config().getJsonObject("dbConnections").getJsonObject(connectionName);
return switch (DatabaseType.valueOf(conf.getString("dbType"))){
case POSTGRESQL -> PostgresConnection.getInstance(conf);
case MYSQL -> MySQLConnection.getInstance(conf);
Expand Down

0 comments on commit f175ec9

Please sign in to comment.