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

Document relationship between min_idle, idle_timeout and max_lifetime #127

Open
xmo-odoo opened this issue Feb 18, 2022 · 1 comment
Open

Comments

@xmo-odoo
Copy link

xmo-odoo commented Feb 18, 2022

Looking at the documentation of Builder doesn't currently help understand r2d2's behaviour, when trying to answer questions like "how do I make sure there's always at least one connection at any given instant".

This is related to ivanceras/r2d2-sqlite#39: currently ::memory is basically broken (at least in the sense of pooling connection, every connection from the pool is independent).

It's possible that sqlite's mode=memory could be used to fix the issue (at least in part, it has limitations still) but sqlite will automatically delete and release the database if it has no connections open, so for this to work properly there needs to be a way to configure the pool such that once the first connection has been created there is always at least one connection in the pool at any instant.

@sfackler
Copy link
Owner

If you set idle_timeout and max_lifetime to None, your connections should always stay open.

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