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

Does HikariCP supports command timeout in Spring Boot application similar to C#

Does HikariCP supports command timeout in Spring Boot application similar to C# I am using Hikari Connection Pool in my Spring boot application. I have enabled connectionTimeout using the following…
Thiagarajan Ramanathan
  • 1,035
  • 5
  • 24
  • 32
1
vote
0 answers

Seeking advice on technologies to use for a project: ORMs, Building reactive interfaces, etc

My friend and I are starting a relatively ambitious long term project and we require some assistance deciding which technologies would be best suited for our needs. We would be very grateful for any advice or opinions on which technologies would be…
1
vote
0 answers

How to change the username/password and database runtime using HikariCP

I have a multi tenant application that tries to connect to database per tenant and each database will have its own username/password. I want to achieve this using a single datasource by switching between the datasources and users. I tried to set the…
Srik91
  • 79
  • 2
  • 12
1
vote
0 answers

AWS Java SDK - Timeout waiting for connection from pool

I am working with AmazonSQS. I am using threads to read content from there, after a short time, I get the connection pool error this is my thread logic ReceiveMessageRequest request = new…
1
vote
1 answer

How to get info about connection Id at request?

I want to get the connection Id (threadId) when executing long query just in case the user at frontend (Vue.js) wants to cancel the query (in case query never ends...). So when the user clicks "Stop query", I would perform KILL (threadId) on…
Gregor Sotošek
  • 357
  • 1
  • 4
  • 22
1
vote
1 answer

MongoDB - The wait queue for acquiring a connection to server is full

I am using the below code to connect mongo DB. public static class MongoDBHandler { static IMongoClient _client; static IMongoDatabase _database; static string MongoDBConnectionString; static IMongoClient mClientConnection() { …
1
vote
1 answer

How does mysql connection pooling works with Node microservices?

I have two node microservices talking to one common mysql database. Both microservices have this below code to create a connection pool with a connectionlimit of 10 as follows: // Initializing pool var pool = mysql.createPool({ connectionLimit:…
1
vote
1 answer

Curl connection pooling in PHP

Is there a way to pool or reuse HTTP connections with PHP's curl client? I already found Persistent/keepalive HTTP with the PHP Curl library?, but it only allows connection reuse on the same handle, and there isn't a good way to persist handles…
David Ehrmann
  • 7,366
  • 2
  • 31
  • 40
1
vote
4 answers

Detecting unusable pooled SqlConnections

When I attempt to set an application role on a SqlConnection with sp_setapprole I sometimes get the following error in the Windows event log... The connection has been dropped because the principal that opened it subsequently assumed a new security…
Ed Guiness
  • 34,602
  • 16
  • 110
  • 145
1
vote
3 answers

What does creating a connection between an application and database mean?

When we say we have created a connection between a database and an application (that can be stored in connection pool), what really a "connection" means here? Does it got anything to do with establishing a TCP/ TLS connection? Does it load the…
Vishrant
  • 15,456
  • 11
  • 71
  • 120
1
vote
1 answer

how to create a connection pool/only once for a third party Application?

I'm using JAVA/Spring MVC and I need to make a Connection Pool for a Third Party Application integration in my application becouse when i try to connect it multiple time my application and server System utilize 100% RAM. here i have to problem, when…
Sushil Kumar
  • 84
  • 1
  • 10
1
vote
1 answer

Cron Job for Python Script and Tweepy

so I have a script in python that posts tweets to my twitter account. I'm using tweepy. When I run the script manually with either ./run_my_script.py or python run_my_script.py it works just fine. I'm trying to run it via cronjob and no matter what…
1
vote
0 answers

Java ComboPooledDataSource exceeds pool size and does not reuse

I have the following code that gets called by an other application (That I can not change) to read form a Database. The method is called in a loop very often and DOSes the DB. At The DB I can see that there are many connecetions opend ... increasing…
PaulEdison
  • 897
  • 1
  • 15
  • 36
1
vote
1 answer

pgbouncer: user,password per pool

I'm trying to setup a pgbouncer pool that connects to the database using a pool definition that includes a user and password. Subsequently each client application should connect using a different user and password. The idea is that one pool is…
Bernie Lenz
  • 1,967
  • 23
  • 45
1
vote
0 answers

How to set properties of Tomcat JDBC Pool when using Spring Cloud Connector config?

I want to configure the properties of the Tomcat JDBC Pool with custom parameter values. The pool is bootstrapped by the spring-cloud (Spring Cloud Connector) environment (Cloud Foundry) and connected to a PostgreSQL database. In particular, I want…
1 2 3
99
100