Skip to content

Commit

Permalink
use sqlHost
Browse files Browse the repository at this point in the history
  • Loading branch information
AlvaroVega committed Apr 18, 2024
1 parent f59d561 commit 79ea114
Showing 1 changed file with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1017,7 +1017,7 @@ public Connection getConnection(String destination, String sqlHost) throws Cygnu
} // if

//DataSource datasource = createConnectionPool(destination);
DataSource datasource = createConnectionPool(sqlHost);
DataSource datasource = createConnectionPool(destination, sqlHost);
//datasources.put(destination, datasource);
datasources.put(sqlHost, datasource);
connection = datasource.getConnection();
Expand Down Expand Up @@ -1114,11 +1114,14 @@ protected int numConnectionsCreated() {
* @throws Exception
*/
@SuppressWarnings("unused")
private DataSource createConnectionPool(String destination) throws Exception {
private DataSource createConnectionPool(String destination, String sqlHost) throws Exception {
GenericObjectPool gPool = null;
if (pools.containsKey(destination)){
LOGGER.debug(sqlInstance.toString().toUpperCase() + " Pool recovered from Cache (" + destination + ")");
gPool = pools.get(destination);
//if (pools.containsKey(destination)){
if (pools.containsKey(sqlHost)){
//LOGGER.debug(sqlInstance.toString().toUpperCase() + " Pool recovered from Cache (" + destination + ")");
LOGGER.debug(sqlInstance.toString().toUpperCase() + " Pool recovered from Cache (" + sqlHost + ")");
//gPool = pools.get(destination);
gPool = pools.get(sqlHost);
}else{
String jdbcUrl = generateJDBCUrl(destination);
Class.forName(sqlDriverName);
Expand Down

0 comments on commit 79ea114

Please sign in to comment.