From f175ec9c4ed6425e1f69617c5f37f1a5e89fddbb Mon Sep 17 00:00:00 2001 From: Areeb Gillani Date: Mon, 4 Sep 2023 06:39:24 +0500 Subject: [PATCH] - Context error handling --- .../java/io/github/areebgillani/db/boost/ConnectionManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/io/github/areebgillani/db/boost/ConnectionManager.java b/src/main/java/io/github/areebgillani/db/boost/ConnectionManager.java index d2b21c4..cb159d4 100644 --- a/src/main/java/io/github/areebgillani/db/boost/ConnectionManager.java +++ b/src/main/java/io/github/areebgillani/db/boost/ConnectionManager.java @@ -14,7 +14,7 @@ public class ConnectionManager { private static final HashMap dbConnectionMap = new HashMap<>(); private static 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);