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_r390237955
 
 

 ##########
 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:
   ```suggestion
   // https://github.com/brettwooldridge/HikariCP/wiki/MySQL-Configuration
   ```
   
   reading https://github.com/brettwooldridge/HikariCP#statement-cache I at 
first wasn't sure what the following properties do, but then found 
https://github.com/brettwooldridge/HikariCP/wiki/MySQL-Configuration ... if 
these are inspired by that, I suggest putting that link inline into the code 
here, for future readers.

----------------------------------------------------------------
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