Skip to content
This repository has been archived by the owner on Feb 16, 2021. It is now read-only.

Question: Connection test with dead DB #35

Open
rsasai opened this issue Jul 21, 2016 · 0 comments
Open

Question: Connection test with dead DB #35

rsasai opened this issue Jul 21, 2016 · 0 comments

Comments

@rsasai
Copy link

rsasai commented Jul 21, 2016

This is not an issue but a question.

How can I get a fast response from the connection test when the DB is not started?

My connection test is 'select 1 ...' to DB via your module.
When the DB is alive it comes back in 3 ms, which is good.
However, the DB is not alive, it takes 3 seconds before the response is back.

Is the following (c3p0 doc) any relevant? If so how can I use that via your module?
Any other suggestions will be much appreciated. Thank you.

When configuring Connection testing, first try to minimize the cost of each test. If you are using a JDBC driver that you are certain supports the new(ish) jdbc4 API — and if you are using c3p0-0.9.5 or higher! — let your driver handle this for you. jdbc4 Connections include a method called isValid() that should be implemented as a fast, reliable Connection test. By default, c3p0 will use that method if it is present.

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

No branches or pull requests

1 participant