Questions tagged [connection-pool]

In software engineering, a connection pool is a cache of database connections maintained so that the connections can be reused when future requests to the database are required. Connection pools are used to enhance the performance of executing commands on a database.

Filter by
Sorted by
Tagged with
1
vote
0answers
86 views

Consumer Producer problem solution using JDBI, MySQL, HikariCP

The app suppose to solve a subset of Producer–consumer problem. One producer, one consumer thread and buffer. The idea of the app to handle correctly database downtimes. The solution is to keep ...
1
vote
1answer
71 views

Using MySQL with Wai and Warp

I was wondering if below is the correct convention for combining Wai with a Database pool. What I basically do is, create a pool, partially apply a function of type ...
2
votes
0answers
371 views

Wrapper for sql.Connection

I wrote wrapper for Connection. It uses my Connection pool implementation. When the wrapper closes, the connection goes back to pool. ...
1
vote
0answers
112 views

Node.js pg-pool db connection acquisition, use and release

I am trying to use pg-pool to connect to my DB and perform queries using a connection pool. Here is how I do it, but to be sure I'm not doing it wrong, or to see if there is a better way, please ...
6
votes
2answers
1k views

Connection Pool in Java 8 using Strategy and Factory Pattern

How can I improve the following code and features? It is based on active911's C++ connection pool. The full code and unit tests are here : https://github.com/spakai/connection_pool the README ...
9
votes
2answers
1k views

C++11 Blocking connection pool with auto release

Relatively new to C++. Please help me understand the potential issues with the following blocking object pool. ...
4
votes
1answer
825 views

Pool of curl handles

I am trying to write a simple reusable pool of curl handles. I found this wonderful implementation of the blocking queue. The pool itself looks like this: ...
1
vote
0answers
337 views

Concurrent SSH session pool

In my application I need to perform several SSH commands from Windows to a Linux machine. Since I need to reduce as much as possible the SSH calls overhead and also limit the number of concurrent ...
2
votes
1answer
338 views

Resource pooling in TypeScript

As an exercise, and in an effort to avoid wrapping callback APIs in every node library it seems, I threw together a resource pool class. The intended usage is the following: ...
2
votes
0answers
128 views

Safest Connection pool in Java

I have read the code reviews on this website: this one and this one So creating the pool in itself might not be that difficult, I'm more worried about the client closing the connection or the ...
3
votes
2answers
12k views

Simple singleton database connection pool

I'm studying design patterns, and to demonstrate a singleton, I've implemented a primitive database connection pool. ConnectionPool.java ...
1
vote
1answer
82 views

Java REST WS with DB

I want to get the feedback this code about the best practice I should follow and if I am using the connection pooling properly. I have classes as follows: ...
1
vote
1answer
179 views

Passing connection for multiple classes/methods

I have made a connection method which returns TCPMasterConnection. ...
2
votes
1answer
1k views

Connection pool for java.sql.Connection

I have made a connection pool for SQL Connection objects. The purpose of this object is to provide multi threaded support for the accessing of the underlying ...
3
votes
1answer
1k views

TCP connection pool

I am looking for any feedback on my connection pool implementation (I removed the documentation so this post isn't so bloated). The pool times-out idle connections after a certain timeout interval ...
1
vote
0answers
552 views

Custom connection pool

I have a project, that creates a custom DataBaseConnection pool as below: ...
10
votes
2answers
12k views

Manage connection without 'using' statement

I replace this common statement: ...
0
votes
1answer
130 views

ConnectionPool using LinkedBlockingDeque

Below is the code snippet that I developed for ConnectionPool. Kindly let me know if there are any problems or shortcomings with the below code. I've deployed it to our test environment and was able ...
1
vote
1answer
1k views

JavaSE client: is this how to get a new JPA EntityManager each time? (DAO)

This class functions, in that the program can be left open for hours and it will still reconnect to the database when the user prompts for a CRUD operation. I've read about DAO, and some other ...
6
votes
3answers
1k views

Connecting to RabbitMQ

I would like a review for this connection to RabbitMQ. I just developed it and seems to be working well, but I would like another set of eyes on it before putting this on the sever. ...
4
votes
1answer
4k views

Multithreaded app for writing to a MySQL database

I have a multi-threaded app (WCF) that writes to a MySQL db. I want to use MySQL's built in connection pooling abilities. As far as I can tell, to do that, I should set ...
4
votes
1answer
612 views

Generic object pool - what should be changed to make it easier to understand?

I have created a simple class that maintains a pool (with maximum size) of objects. It acts like a connection pool (that is where the name came from - initially it was used just to maintain a pool of ...
26
votes
3answers
27k views

Connection pool implementation

I wanted to try out writing an minimalistic connection pool implementation (out of curiosity and for learning). Could you all please review the code and provide feedback? There are two classes (...
0
votes
2answers
2k views

JSON API in C++ with Node.native, RapidJSON, and MySQL

I was hoping I might get some feedback and ideas for improvement on this, particularly the WebRouter class. ...