title: Too Many Connections Error on RDS MySql via EC2 Jenkins
body: <p>I'm getting a too many connections error when accessing my AWS RDS MySql through my EC2 Jenkins server on when doing maven clean install (when running the tests), This doesn't happen when i run it locally, also accessing RDS.</p>
  
  <p>I tried increasing the Max_Connections in the RDS configuration to no avail.</p>
  
  <p>Here's my pom.xml:</p>
  
  <pre><code>&lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  &lt;groupId&gt;org.springframework&lt;/groupId&gt;
  &lt;artifactId&gt;plenty&lt;/artifactId&gt;
  &lt;version&gt;0.1.0&lt;/version&gt;
  &lt;packaging&gt;war&lt;/packaging&gt;
  
  &lt;parent&gt;
      &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
      &lt;artifactId&gt;spring-boot-starter-parent&lt;/artifactId&gt;
      &lt;version&gt;1.2.0.RC2&lt;/version&gt;
  &lt;/parent&gt;
  
  &lt;dependencies&gt;
  
      &lt;!-- Spring --&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework&lt;/groupId&gt;
          &lt;artifactId&gt;spring-webmvc&lt;/artifactId&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework&lt;/groupId&gt;
          &lt;artifactId&gt;spring-orm&lt;/artifactId&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-actuator&lt;/artifactId&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-security&lt;/artifactId&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-tomcat&lt;/artifactId&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-jdbc&lt;/artifactId&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-data-jpa&lt;/artifactId&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-test&lt;/artifactId&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.data&lt;/groupId&gt;
          &lt;artifactId&gt;spring-data-rest-webmvc&lt;/artifactId&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-test&lt;/artifactId&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.security&lt;/groupId&gt;
          &lt;artifactId&gt;spring-security-test&lt;/artifactId&gt;
          &lt;version&gt;4.0.0.M1&lt;/version&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework&lt;/groupId&gt;
          &lt;artifactId&gt;spring-test&lt;/artifactId&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.security.oauth&lt;/groupId&gt;
          &lt;artifactId&gt;spring-security-oauth&lt;/artifactId&gt;
          &lt;version&gt;2.0.1.RELEASE&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;com.jayway.jsonpath&lt;/groupId&gt;
          &lt;artifactId&gt;json-path-assert&lt;/artifactId&gt;
          &lt;version&gt;1.2.0&lt;/version&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;com.fasterxml.jackson.datatype&lt;/groupId&gt;
          &lt;artifactId&gt;jackson-datatype-hibernate4&lt;/artifactId&gt;
          &lt;version&gt;2.5.0&lt;/version&gt;
      &lt;/dependency&gt;
  
  
  
      &lt;!-- Hibernate / jpa --&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
          &lt;artifactId&gt;hibernate-core&lt;/artifactId&gt;
          &lt;version&gt;4.3.8.Final&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
          &lt;artifactId&gt;hibernate-entitymanager&lt;/artifactId&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
          &lt;artifactId&gt;hibernate-validator&lt;/artifactId&gt;
      &lt;/dependency&gt;
  
  
      &lt;!-- Needed in XML processing for Wagnet --&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.ws&lt;/groupId&gt;
          &lt;artifactId&gt;spring-xml&lt;/artifactId&gt;
          &lt;version&gt;2.2.0.RELEASE&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;mysql&lt;/groupId&gt;
          &lt;artifactId&gt;mysql-connector-java&lt;/artifactId&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.tomcat&lt;/groupId&gt;
          &lt;artifactId&gt;tomcat-jdbc&lt;/artifactId&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.gdal&lt;/groupId&gt;
          &lt;artifactId&gt;gdal&lt;/artifactId&gt;
          &lt;version&gt;1.10.1&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;com.amazonaws&lt;/groupId&gt;
          &lt;artifactId&gt;aws-java-sdk&lt;/artifactId&gt;
          &lt;version&gt;1.8.7&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.commons&lt;/groupId&gt;
          &lt;artifactId&gt;commons-lang3&lt;/artifactId&gt;
          &lt;version&gt;3.3.2&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;!-- GeoTools --&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.geotools&lt;/groupId&gt;
          &lt;artifactId&gt;gt-shapefile&lt;/artifactId&gt;
          &lt;version&gt;${geotools.version}&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.geotools&lt;/groupId&gt;
          &lt;artifactId&gt;gt-swing&lt;/artifactId&gt;
          &lt;version&gt;${geotools.version}&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.geotools&lt;/groupId&gt;
          &lt;artifactId&gt;gt-geometry&lt;/artifactId&gt;
          &lt;version&gt;${geotools.version}&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.geotools&lt;/groupId&gt;
          &lt;artifactId&gt;gt-epsg-hsql&lt;/artifactId&gt;
          &lt;version&gt;${geotools.version}&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.geotools&lt;/groupId&gt;
          &lt;artifactId&gt;gt-epsg-hsql&lt;/artifactId&gt;
          &lt;version&gt;${geotools.version}&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.geotools&lt;/groupId&gt;
          &lt;artifactId&gt;gt-xml&lt;/artifactId&gt;
          &lt;version&gt;${geotools.version}&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.scala-lang&lt;/groupId&gt;
          &lt;artifactId&gt;scala-library&lt;/artifactId&gt;
          &lt;version&gt;2.10.4&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.neo4j&lt;/groupId&gt;
          &lt;artifactId&gt;neo4j-kernel&lt;/artifactId&gt;
          &lt;version&gt;2.1.5&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-aop&lt;/artifactId&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.neo4j&lt;/groupId&gt;
          &lt;artifactId&gt;neo4j-cypher-compiler-2.1&lt;/artifactId&gt;
          &lt;version&gt;2.1.5&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;net.wimpi&lt;/groupId&gt;
          &lt;artifactId&gt;telnetd-x&lt;/artifactId&gt;
          &lt;version&gt;2.1.1&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;!-- project lombok --&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.projectlombok&lt;/groupId&gt;
          &lt;artifactId&gt;lombok&lt;/artifactId&gt;
          &lt;version&gt;1.14.8&lt;/version&gt;
          &lt;scope&gt;provided&lt;/scope&gt;
      &lt;/dependency&gt;
  
      &lt;!-- jsr-275, used for measurements --&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;javax.measure&lt;/groupId&gt;
          &lt;artifactId&gt;jsr-275&lt;/artifactId&gt;
          &lt;version&gt;1.0.0&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.neo4j&lt;/groupId&gt;
          &lt;artifactId&gt;neo4j-cypher-compiler-2.0&lt;/artifactId&gt;
          &lt;version&gt;2.0.3&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;!-- Optaplanner --&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.optaplanner&lt;/groupId&gt;
          &lt;artifactId&gt;optaplanner-core&lt;/artifactId&gt;
          &lt;version&gt;6.2.0.CR4&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;!-- apache commons --&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.commons&lt;/groupId&gt;
          &lt;artifactId&gt;commons-lang3&lt;/artifactId&gt;
          &lt;version&gt;3.3.2&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.jadira.usertype&lt;/groupId&gt;
          &lt;artifactId&gt;usertype.jodatime&lt;/artifactId&gt;
          &lt;version&gt;2.0.1&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.activemq&lt;/groupId&gt;
          &lt;artifactId&gt;activemq-client&lt;/artifactId&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;xalan&lt;/groupId&gt;
          &lt;artifactId&gt;xalan&lt;/artifactId&gt;
          &lt;version&gt;2.7.1&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
          &lt;artifactId&gt;hibernate-jpamodelgen&lt;/artifactId&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.neo4j&lt;/groupId&gt;
          &lt;artifactId&gt;neo4j-cypher-compiler-1.9&lt;/artifactId&gt;
          &lt;version&gt;2.0.3&lt;/version&gt;
      &lt;/dependency&gt;
  &lt;/dependencies&gt;
  
  &lt;properties&gt;
      &lt;start-class&gt;com.rdthree.plenty.Application&lt;/start-class&gt;
      &lt;geotools.version&gt;12-RC1&lt;/geotools.version&gt;
  
  &lt;/properties&gt;
  
  &lt;build&gt;
      &lt;resources&gt;
          &lt;resource&gt;
              &lt;directory&gt;src/main/scripts&lt;/directory&gt;
          &lt;/resource&gt;
          &lt;resource&gt;
              &lt;directory&gt;src/main/resources&lt;/directory&gt;
          &lt;/resource&gt;
      &lt;/resources&gt;
      &lt;plugins&gt;
          &lt;plugin&gt;
              &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
              &lt;configuration&gt;
                  &lt;source&gt;1.7&lt;/source&gt;
                  &lt;target&gt;1.7&lt;/target&gt;
              &lt;/configuration&gt;
          &lt;/plugin&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
              &lt;artifactId&gt;maven-surefire-plugin&lt;/artifactId&gt;
              &lt;version&gt;2.18.1&lt;/version&gt;
              &lt;configuration&gt;
                  &lt;!-- &lt;forkCount&gt;1&lt;/forkCount&gt; --&gt;
                  &lt;!-- &lt;reuseForks&gt;true&lt;/reuseForks&gt; --&gt;
                  &lt;argLine&gt;-XX:MaxPermSize=128m&lt;/argLine&gt;
                  &lt;includes&gt;
                      &lt;include&gt;**/Test*.java&lt;/include&gt;
                  &lt;/includes&gt;
              &lt;/configuration&gt;
          &lt;/plugin&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-maven-plugin&lt;/artifactId&gt;
          &lt;/plugin&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;
              &lt;artifactId&gt;sql-maven-plugin&lt;/artifactId&gt;
              &lt;version&gt;1.5&lt;/version&gt;
  
              &lt;dependencies&gt;
                  &lt;dependency&gt;
                      &lt;groupId&gt;mysql&lt;/groupId&gt;
                      &lt;artifactId&gt;mysql-connector-java&lt;/artifactId&gt;
                      &lt;version&gt;5.1.9&lt;/version&gt;
                  &lt;/dependency&gt;
              &lt;/dependencies&gt;
  
              &lt;configuration&gt;
                  &lt;driver&gt;com.mysql.jdbc.Driver&lt;/driver&gt;
                  &lt;url&gt;${mysql.url}&lt;/url&gt;
                  &lt;username&gt;${mysql.username}&lt;/username&gt;
                  &lt;password&gt;${mysql.password}&lt;/password&gt;
                  &lt;forceMojoExecution&gt;true&lt;/forceMojoExecution&gt;
                  &lt;!-- &lt;settingsKey&gt;mysql&lt;/settingsKey&gt; --&gt;
              &lt;/configuration&gt;
  
              &lt;executions&gt;
                  &lt;execution&gt;
                      &lt;id&gt;create-schema&lt;/id&gt;
                      &lt;phase&gt;process-test-resources&lt;/phase&gt;
                      &lt;goals&gt;
                          &lt;goal&gt;execute&lt;/goal&gt;
                      &lt;/goals&gt;
                      &lt;configuration&gt;
                          &lt;autocommit&gt;true&lt;/autocommit&gt;
                          &lt;srcFiles&gt;
                              &lt;srcFile&gt;src/main/scripts/plenty-db.sql&lt;/srcFile&gt;
                          &lt;/srcFiles&gt;
                      &lt;/configuration&gt;
                  &lt;/execution&gt;
              &lt;/executions&gt;
          &lt;/plugin&gt;
      &lt;/plugins&gt;
  &lt;/build&gt;
  
  &lt;repositories&gt;
      &lt;repository&gt;
          &lt;id&gt;spring-milestones&lt;/id&gt;
          &lt;name&gt;Spring Milestones&lt;/name&gt;
          &lt;url&gt;http://repo.spring.io/milestone&lt;/url&gt;
          &lt;snapshots&gt;
              &lt;enabled&gt;false&lt;/enabled&gt;
          &lt;/snapshots&gt;
      &lt;/repository&gt;
      &lt;repository&gt;
          &lt;id&gt;osgeo&lt;/id&gt;
          &lt;name&gt;Open Source Geospatial Foundation Repository&lt;/name&gt;
          &lt;url&gt;http://download.osgeo.org/webdav/geotools&lt;/url&gt;
      &lt;/repository&gt;
  &lt;/repositories&gt;
  &lt;pluginRepositories&gt;
      &lt;pluginRepository&gt;
          &lt;id&gt;spring-snapshots&lt;/id&gt;
          &lt;name&gt;Spring Snapshots&lt;/name&gt;
          &lt;url&gt;http://repo.spring.io/libs-snapshot&lt;/url&gt;
          &lt;snapshots&gt;
              &lt;enabled&gt;true&lt;/enabled&gt;
          &lt;/snapshots&gt;
      &lt;/pluginRepository&gt;
  &lt;/pluginRepositories&gt;
  </code></pre>
  
  <p></p>