vorburger commented on a change in pull request #722: Fineract-796 - Use Hikari 
instead of Tomcat Connection Pool
URL: https://github.com/apache/fineract/pull/722#discussion_r399663726
 
 

 ##########
 File path: 
fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/service/TomcatJdbcDataSourcePerTenantService.java
 ##########
 @@ -85,26 +85,30 @@ private DataSource createNewDataSourceFor(final 
FineractPlatformTenantConnection
         // 
http://www.tomcatexpert.com/blog/2010/04/01/configuring-jdbc-pool-high-concurrency
 
         // see also org.apache.fineract.DataSourceProperties.setDefaults()
-         String jdbcUrl = 
this.driverConfig.constructProtocol(tenantConnectionObj.getSchemaServer(), 
tenantConnectionObj.getSchemaServerPort(), tenantConnectionObj.getSchemaName()) 
;
-        //final String jdbcUrl = tenantConnectionObj.databaseURL();
-        final PoolConfiguration poolConfiguration = new PoolProperties();
-        
poolConfiguration.setDriverClassName(this.driverConfig.getDriverClassName());
-        poolConfiguration.setName(tenantConnectionObj.getSchemaName() + 
"_pool");
-        poolConfiguration.setUrl(jdbcUrl);
-        poolConfiguration.setUsername(tenantConnectionObj.getSchemaUsername());
-        poolConfiguration.setPassword(tenantConnectionObj.getSchemaPassword());
-
-        poolConfiguration.setInitialSize(tenantConnectionObj.getInitialSize());
-
-        
poolConfiguration.setTestOnBorrow(tenantConnectionObj.isTestOnBorrow());
-        poolConfiguration.setValidationQuery("SELECT 1");
-        
poolConfiguration.setValidationInterval(tenantConnectionObj.getValidationInterval());
-
-        
poolConfiguration.setRemoveAbandoned(tenantConnectionObj.isRemoveAbandoned());
-        
poolConfiguration.setRemoveAbandonedTimeout(tenantConnectionObj.getRemoveAbandonedTimeout());
-        
poolConfiguration.setLogAbandoned(tenantConnectionObj.isLogAbandoned());
-        
poolConfiguration.setAbandonWhenPercentageFull(tenantConnectionObj.getAbandonWhenPercentageFull());
-        poolConfiguration.setDefaultAutoCommit(true);
+         String jdbcUrl = 
this.driverConfig.constructProtocol(tenantConnectionObj.getSchemaServer(), 
tenantConnectionObj.getSchemaServerPort(), tenantConnectionObj.getSchemaName());
+
+        HikariConfig config = new HikariConfig();
+        config.setDriverClassName(this.driverConfig.getDriverClassName());
+        config.setPoolName(tenantConnectionObj.getSchemaName() + "_pool");
+        config.setJdbcUrl(jdbcUrl);
+        config.setUsername(tenantConnectionObj.getSchemaUsername());
+        config.setPassword(tenantConnectionObj.getSchemaPassword());
+
+        
config.setValidationTimeout(tenantConnectionObj.getValidationInterval());
+
 
 Review comment:
   @xurror it looks like we lost this again? I'll merge this, and then raise a 
follow-up PR for you to review where I'll propose to add something like this 
back again...

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to