I'm implementing several JavaSE applications on single server. Is it possible to setup a single connection pool (e.g. C3P0) and share among these applications? I just want to have an easy way to manage the total number of DB connections.
Is there any drawbacks using such centralized connection pool?
Thank you, Wilson
A pool contains two types of connections: Active connection: In use by the application. Idle connection: Available for use by the application.
For optimal performance, use a pool with eight to 16 connections per node. For example, if you have four nodes configured, then the steady-pool size must be set to 32 and the maximum pool size must be 64.
Connection pooling means that connections are reused rather than created each time a connection is requested. To facilitate connection reuse, a memory cache of database connections, called a connection pool, is maintained by a connection pooling module as a layer on top of any standard JDBC driver product.
You can simply use the same data source defined in the server for all application to share the same DB connection pool easily.
One obvious drawback would be that performance of independent application may degrade due to a load on totally unrelated application which would be hard to figure out.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With