Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

minPoolSize of 0 #151

Open
azadbolour opened this issue Jul 25, 2020 · 1 comment
Open

minPoolSize of 0 #151

azadbolour opened this issue Jul 25, 2020 · 1 comment

Comments

@azadbolour
Copy link

I have an application that is idle most of the time, but may have bursts of activity from time to time. During the times it is idle, I'd like to have 0 connections to the database, so that the database can be quiesced. Using a serverless database like AWS Aurora, I would then only have to pay for minutes that the database is actually active, and save on the cost of operating the database.

Reading the C3P0 configuration documentation it appeared as if a minPoolSize of 0 implies the lack of a minimum, rather than a minimum of 0. Would appreciate confirmation of the meaning of a minPoolSize of 0.

Is there any way to force C3P0 to close every connection it has to the database during an idle period? Incurring the cost of opening connections during bursts of activity is tolerable for my particular use case.

Many thanks.

Azad

@swaldman
Copy link
Owner

Hi,

c3p0 has a config parameter for this, maxIdleTimeExcessConnections. You can just set this, and minPoolSize to 0, and you should get what you want.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants