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
0 answers

Connection not released back to the tomcat jdbc pool

I have a grails2 based application which is using tomcat jdbc pool, recently I have been getting into problem where all the connections in the pool get used up and I start getting:- org.springframework.transaction.CannotCreateTransactionException:…
thickGlass
  • 540
  • 1
  • 5
  • 19
1
vote
1 answer

Local and Remote connection pools, Java DBCP

I have the following use-case: I have a system that needs to use two different connection pools, One is for 'local' database (Meaning a database running on the local machine) and the other one is a 'remote' database. (Meaning a database that is…
StationaryTraveller
  • 1,449
  • 2
  • 19
  • 31
1
vote
1 answer

issues when using pycassa with uwsgi

We are using pycassa with uwsgi. There are about 16 uwsgi processes. It is strange that one process can get the data which is queried by another process. e.g. there is one row in column family A, looks like: {row_key, {'column_a': 1, 'column_b':…
Zhongwei Sun
  • 125
  • 1
  • 7
1
vote
2 answers

Java jdbc Sql Server parallel writes

I have a scenario with the following steps: Using mssql jdbc driver I need to connect to a Sql Server database table A and get several millions of rows. I need to perform several processing and parsing from the table data and also data coming…
revy
  • 3,945
  • 7
  • 40
  • 85
1
vote
1 answer

Using multiple threadpools and connection pool

I am currently using 5 threadpools and I want to find optimal sizing for these pools. This is some kind of prior analysis. Pools are divided by usage: for handling commands (cmdPool), handling inventory transactions (invPool), pool for database…
Cycan
  • 13
  • 3
1
vote
1 answer

Effect of break statement on DB connection within using block in C#

When working on a project which uses a lot of database connections, I've been encountering a number of errors relating to timeouts when acquiring a connection from the pool using MSSQL. As a matter of course, all the DB connectivity is in using…
Alex
  • 1,643
  • 1
  • 14
  • 32
1
vote
0 answers

How to manage HikariCP connections when they leak?

We have a Java web application that gets a connection from Hikari connection pool (ver. 3.2.0) in an HttpServlet as soon as it receives a request and closes it when the response is returned. We set the leakDetectionThreshold and the…
1
vote
0 answers

how to create single common class for jdbc connection pool

I am using jdbc connection pooling and i am getting the connection more than 100 place in the web application. how can i write the common code in single class and call, where required. Context initContext = new InitialContext(); Context envContext…
1
vote
0 answers

SQL Connection seems open

I have the return ExecuteScalar inside using blocks. And when I run the method for the first time it takes some time(I am using localhost). When I run same method for the second time it is very quick, like the connection was open. WHy is it so quick…
1
vote
1 answer

Isn't a connection the same as a session?

I'm trying to figure when temporary tables are created and deleted. I thought that a temporary table is dropped at the end of a session, but this test makes me unsure of that. The connection string has Pooling=true;Maximum Pool Size=50 so there is…
Joel
  • 8,502
  • 11
  • 66
  • 115
1
vote
1 answer

How to do we know , if spring boot application is using connection pool

I have one spring boot application and am using managed postgres as backend. I do not have any admin permissions on postgres. If i do not mention anything in my spring boot application, does that mean is it using some connection pooling? my spring…
Bravo
  • 8,589
  • 14
  • 48
  • 85
1
vote
1 answer

Getting mysql:"Too many connections" despite using createPool in NodeJs

I am using Observables to display real-time data in Angular2+ application and the back-end is written in NodeJs that uses MySQL database. Since I am using Observables, I need tens of millions of connections of MySQL to keep the real-time work…
Techdive
  • 997
  • 3
  • 24
  • 49
1
vote
1 answer

Is preparedstatement cache at connection pool level better than setting cache at jdbc driver level in a multi threaded env?

Was exploring the HikariCP connection pooling library, currently in an application we use Apache DBCP2 for providing a connection pool,which allows setting the preparedstatement cache at connection pooling level by specifiying these…
yolob 21
  • 385
  • 4
  • 19
1
vote
1 answer

Why is the 'Resource Pool' not supported on the current platform?

What could be the possible causes for the following exception? System.PlatformNotSupportedException: 'ResourcePool' is not supported on the current platform. at System.EnterpriseServices.Platform.Assert(Boolean fSuccess, String function) at…
Magnus Lindhe
  • 7,157
  • 5
  • 48
  • 60
1
vote
2 answers

Django with Peewee Connection Pooling MySQL disconnect

I'm running a Django project with Peewee in Python 3.6 and trying to track down what's wrong with the connection pooling. I keep getting the following error on the development server (for some reason I never experience this issue on my local…
Nick Gotch
  • 9,167
  • 14
  • 70
  • 97
1 2 3
99
100