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

Postgres 10 pooling issue

I 'm using Postgres 10 And I would like to limit connections via pooling. I use this syntax: "my conexion": "Host=myhost; Port=5432; Database=mydb; Username=postgres; Password=XXX; Persist Security…
Luis Diaz
  • 11
  • 5
1
vote
1 answer

Knex.js force session reuse for 4 following queries

I have a sub-query that is being used in four different queries that all execute to present some dashboard like functionality. The common ground for all queries is this sub-query which I want to extract in a temporary table. This has been a success,…
1
vote
0 answers

PostgreSQL + Apache connection pooling: MaxIdle and MaxActive vs RAM usage

We are running a PostgreSQL database in the Google Cloud. On top of this we have an app. In the app we can configure runtime connection pooling settings for the database. Our Google SQL server has 30GB ram so the default max_connections is 500 as I…
1
vote
1 answer

Why do is my sql pool connection being closed suddenly

I'm using a pool to make queires to my db within a class , while i run this class in 16 instances (with limit of 100 connections per each - I don't know if this high number has anything to do with the error) And suddenly after some time of running…
Sw Sx
  • 77
  • 1
  • 10
1
vote
2 answers

Use MongoDb Connection pooling with Go Application

I am working on a Golang SAAS application along with Mongodb. Previously I worked with db connections without pooling. As a result of this, my db hangs on or shuts down when some traffic comes in. Then I get to know about connection pooling. I…
Amandeep kaur
  • 985
  • 3
  • 15
  • 35
1
vote
1 answer

java optimum jdbc pool size given a Underlying database max connection setting

I'm trying to understand connectionn pooling in application. Supposing we are using a postgresql database with max_connections=100 what should be the best value for connection pool size in my java (or another language) application ? Does it…
soung
  • 1,411
  • 16
  • 33
1
vote
2 answers

Python mysql pool connection fetchall function return 'u' keyword in array

python MySQL pool is returning 'u' key in the array as like - [{u'data': u'{"no_comment":1,"total_reply":2}'}] A required response should be like - [{"data": {"no_comment":1,"total_reply":2}}]. query - "select data from tbl_comment where id =…
1
vote
0 answers

How to do Flask-SQLAlchemy pooling?

This is how I basically create my app and db: from flask import Flask from flask_restful import Api from flask_sqlalchemy import SQLAlchemy app = Flask(__name__) api = Api(app) app.config['SQLALCHEMY_DATABASE_URI'] =…
MattSom
  • 2,097
  • 5
  • 31
  • 53
1
vote
2 answers

Do I need to close my HttpClient if I am reusing the connectionPool in it (java)

Here is a sample program. public class Foobar { private HttpClient; public Foobar(RequestConfig config, PoolingHttpClientConnectionManager, connManager) { return HttpClients.custom() .setDefaultRequestConfig(config) …
brain storm
  • 30,124
  • 69
  • 225
  • 393
1
vote
4 answers

weblogic questions

I have a couple of questions 1) How can we define in weblogic configuration how many concurrent users are allowed or can be allowed at a time to a particular application? 2) how can we tell how may threads are being used in a weblogic at a time? 3)…
user665319
  • 1,419
  • 3
  • 14
  • 13
1
vote
2 answers

How to solve "Using Hibernate built-in connection pool (not for production use!)" using JPA i.e. Hibernate EntityManager

I'm new to Hibernate and JPA in general. I read a lot about this warning, but I still can't solve it. The answers I read so far, said that it is necessary to have hibernate.cfg.xml in the project. But I also read that: If you are using JPA i.e.…
Lulixter
  • 161
  • 1
  • 3
  • 12
1
vote
1 answer

Spring Boot use multiple DataSources in one Transaction

My Setup is the following: I Have a Spring Boot 2.1.1 Application. For Connection Pooling Hikari is used. I would like to write one service which routes the READs to a READER database and the WRITES to a Master database in one transaction/method.…
SupaMario
  • 998
  • 9
  • 14
1
vote
0 answers

Large number of jdbc connections with SQL Server Always On configuration

We are facing a problem in a java based application where the number of database connections to a SQL server database is always increasing. The database is configured in a HA group and the application connection to the database has been configured…
1
vote
0 answers

Problem with connection pool using PoolDataSource through singleton pattern

I am trying to develop a parser that inserts data in Oracle XE. This small program executes 6 threads that will receive data via TCP, parsing them and inserting them into the database. I do this through the Oracle UCP. My database connection code…
Platonzaid
  • 11
  • 2
1
vote
1 answer

PostgreSQL JDBC Connection issue

We have PostgreSQL 9.6 instance at a ubuntu 18.04 machine. When we restart java services deployed in a Kubernetes cluster then already existing idle connection didn't get remove and service create new connections on each restart. Due to this, we…
YogeshR
  • 1,606
  • 2
  • 22
  • 43