Question: Connection test with dead DB #35
Description
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.