Java Web Application fails: exceeding maximum connections to the database
search cancel

Java Web Application fails: exceeding maximum connections to the database

book

Article ID: 294684

calendar_today

Updated On:

Products

Services Suite

Issue/Introduction

Symptoms:
You have a Java web application (Java Web, Grails, Spring, etc...) and it is failing to start stating that the maximum number of connections to the database has been exceeded.

Environment


Cause

This error happens when your application exceeds the maximum number of connections allowed by your database provider. This prevents further connections from being established.

Resolution

There are a few ways to resolve this issue.

1. If you are using Spring Boot, please see this article.

2. From the service side, you can upgrade your service instance so that it supports more simultaneous connections. If you are using Pivotal Web Services, many of the free plans only allow up to four simultaneous connections. To get more, you would need to use a paid plan.

3. From the application side, you can define some limits on your DataSource/connection pool. To do this, you'll need to use the manual service configuration option which is described in the documentation here or this KB article.