From ec5ced8de8fea437acee8e4d2a48e495e3a952c0 Mon Sep 17 00:00:00 2001 From: Joshua Chaitin-Pollak Date: Thu, 12 Mar 2015 03:45:17 -0400 Subject: [PATCH] hard-code connection parameters in an attempt to get Hikari working --- gradle.properties | 3 +-- .../src/main/java/org/springframework/cloud/Cloud.java | 2 +- .../service/relational/HikariCpPooledDataSourceCreator.java | 4 +++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/gradle.properties b/gradle.properties index 1c405b7..49db2cb 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,3 +1,2 @@ -version=1.1.2.BUILD-SNAPSHOT +version=1.1.2.AL2-SNAPSHOT group=org.springframework.cloud - diff --git a/spring-cloud-core/src/main/java/org/springframework/cloud/Cloud.java b/spring-cloud-core/src/main/java/org/springframework/cloud/Cloud.java index 82aafeb..109f3f1 100644 --- a/spring-cloud-core/src/main/java/org/springframework/cloud/Cloud.java +++ b/spring-cloud-core/src/main/java/org/springframework/cloud/Cloud.java @@ -202,7 +202,7 @@ public class Cloud { * * *

- * If a there is only a single service of a given type (as defined by the {@link ServiceInfo.ServiceLabel} + * If a there is only a single service of a given type (as defined by the {link ServiceInfo.ServiceLabel} * annoation's value of the corresponding {@link ServiceInfo} class), that service is aliased * to the service type. Keys for such properties start in cloud.services.<service-type>. * For example, if there is only a single MySQL service bound to the application, the service properties diff --git a/spring-cloud-spring-service-connector/src/main/java/org/springframework/cloud/service/relational/HikariCpPooledDataSourceCreator.java b/spring-cloud-spring-service-connector/src/main/java/org/springframework/cloud/service/relational/HikariCpPooledDataSourceCreator.java index 3a9b404..7e8b71d 100644 --- a/spring-cloud-spring-service-connector/src/main/java/org/springframework/cloud/service/relational/HikariCpPooledDataSourceCreator.java +++ b/spring-cloud-spring-service-connector/src/main/java/org/springframework/cloud/service/relational/HikariCpPooledDataSourceCreator.java @@ -34,8 +34,10 @@ public class HikariCpPooledDataSourceCreator i if (serviceConnectorConfig == null) { // choose sensible values so that we set max connection pool size to what // free tier services on Cloud Foundry and Heroku allow - target.setPropertyValue("maximumPoolSize", 4); + target.setPropertyValue("maximumPoolSize", 10); target.setPropertyValue("connectionTimeout", 30000); + target.setPropertyValue("idleTimeout", 30000); + target.setPropertyValue("maxLifetime", 55000); } configurer.configure(basicDataSource, (DataSourceConfig)serviceConnectorConfig); }