Questions tagged [connection-pooling]

In software engineering, a connection pool is a cache of connections maintained so that the connections can be reused when future requests to the resource are required.

Description

Connection pools are used to enhance the performance of executing commands on a database or other server. Opening and maintaining a connection for each user especially requests made to a dynamic database-driven website application, is costly and wastes resources.

In connection pooling, after a connection is created, it is placed in the pool and it is used over again so that a new connection does not have to be established. If all the connections are being used, a new connection is made and is added to the pool. Connection pooling also cuts down on the amount of time a user must wait to establish a connection to the resource.


Connection Pool libraries

Java

  • HikariCP
    It is considered as one of the best libraries for connection pooling. Play 2.4 Framework uses HikariCP by default.
    Website, GitHub.

  • BoneCP
    It beats older connection pools such as C3P0 and DBCP but should now be considered deprecated in favour of HikariCP.
    Website, GitHub

  • Apache Commons DBCP
    Website.

  • C3P0
    Website, GitHub

3263 questions
1
vote
2 answers

Problems with Tomcat8 using connection pooling to OracleDB

We have an application provided by a 3rd party vendor that runs on Tomcat 8 and JDK 8 to an Oracle 12 DB with ojdbc7.jar & xdb6.jar driver. The application works, but is slower than expected. When investigating it appears the application is…
1
vote
1 answer

In this case from Nygard's "Release it!" why do deadlocks happen?

I'm reading over and over this paragraph from Michael Nygard's book "Release it!" and I still don't understand why exactly deadlocks can happen: Imagine 100,000 transactions all trying to update the same row of the same table in the same…
1
vote
1 answer

Config specific HTTPClient properties in HttpComponentsClientHttpRequestFactory

I'm using spring integration with an http-outbound-gateway using the HttpComponentsClientHttpRequestFactory. I'm having the following exception NoHttpResponseException. 2019-08-13 16:09:51,839 http-bio-8443-exec-439 ERROR LoggingHandler:184 -…
1
vote
2 answers

How to collect and get connection pool statistics using jetty and spring boot?

I'm developing simple Spring Boot web application with embedded Jetty server. I'd like to have some statistics on connection pool usage (i.e. how many threads, avg request time. avg queue wait time, queue size etc.) I realized that Spring Boot…
1
vote
1 answer

Knex pool full on migration

I'm trying to get started with knex.js and I can't get migrations to work. Knex works fine for my API calls. Here's my setup: knexfile.js const env = process.env; module.exports = { client: 'mysql', connection: { host: env.DB_HOST, …
user6647072
  • 131
  • 2
  • 17
1
vote
0 answers

How to load the JDBC Driver Dynamically and use it with connection pool without using DriverManager?

I'm trying to load the JDBC Driver dynamically for some purpose. It will use diffrent Driver with different connection pools and these Drivers need to work independently. Following code will work: URL u = new…
1
vote
1 answer

Reuse connection in database connection pool

As per my understanding, database connection pool usually works this way: create n connections during app initialization and put them into a cache(e.g. a list) a thread will require a connection to do some operation to the db and return the…
Liu Wenzhe
  • 881
  • 2
  • 8
  • 22
1
vote
1 answer

What happens to the new queries when the connection pool is exhausted?

I am developing a back-end with Node.js and MySQL. Sometimes, there are a huge number of queries to be done on the database > 50,000, and I'm using connection pooling. My question is what happens to a query after it is rejected due to the pool being…
Hussein Hijazi
  • 439
  • 4
  • 13
1
vote
1 answer

Why hikari connection pool uses only 1 or 2 connections when receiving simultaeous multiple request?

Hikari Pool looks like using only 1 or 2 connections in many connections in pool. I don't know why? Our service use hikari connection pool on starting my service. maximumPoolSize 50 connectTimeout 3000 and I sent 100 request to our service from…
1
vote
1 answer

Use "dynamic" connection pool for connecting to aurora rds serverless

I have a spring boot application that run in aws as a ECS. This application use a pool of connections for connect to an instance of Aurora RDS serverless. I want to know if there are a mode to "destroy" the pool connection when there are no…
JoeB34r
  • 11
  • 2
1
vote
0 answers

Tedious connection pool returns 401 error when ideal

When using tedious-connection-pool the connection gets terminated after a specific time period when app is in ideal state. How to resolve this? Referred https://github.com/tediousjs/tedious-connection-pool about how to process request using…
Hari Prasath
  • 111
  • 1
  • 2
  • 8
1
vote
1 answer

Connection Pooling in a small application

I've got a few simple questions about connection pooling and best practices. I'm planning and writing a small application which relies on a MySQL database. In this application I use modules and plug-ins which can create connections. The application…
Skalli
  • 2,707
  • 3
  • 27
  • 39
1
vote
1 answer

httpClient connection pool manager validateAfterInactivity

I am looking at the documentation of PoolingHttpClientConnectionManager https://hc.apache.org/httpcomponents-client-ga/httpclient/apidocs/org/apache/http/impl/conn/PoolingHttpClientConnectionManager.html There is an API setValidateAfterInactivity.…
user1892775
  • 2,001
  • 6
  • 37
  • 58
1
vote
1 answer

Connection Pool for OSGI bundle

I'm trying to implement some kind of microservice archetecture using OSGI. I have UserDAO bundle, which get Connection from Connection Pool in another bundle (Connector). They're binded with OSGI service API. So questions is: 1) Should I register…
1
vote
0 answers

Tomee remote jndi Datasource connection pool

I am trying to create a connection pool and trying to consume the Datasource remotely using tomee. I am getting an Exception when i try to do this. I have defined the DataSource resource in tomee.xml. Then I am trying to access this resource…