Deze fout duidt meestal op gelekte connections. Sluit elke Connection, Statement en ResultSet, idealiter met try-with-resources:
public void create(Entity entity) throws SQLException {
try (
Connection connection = dataSource.getConnection();
PreparedStatement statement = connection.prepareStatement(SQL_CREATE)
) {
statement.setSomeObject(1, entity.getSomeProperty());
statement.executeUpdate();
}
}Ook bij pooling moet je de verbinding sluiten; close() geeft de fysieke connection terug aan de pool.