Search code examples
javamysqljdbcc3p0

c3p0 ConnectionTester: Does DATABASE_IS_INVALID cause an immediate removal of the invalid DB?


I see statusOnException return this DATABASE_IS_INVALID on certain exceptions, but I see nothing use this return value.

Is this just a constant that ConnectionTester uses for optional logging, but internally it will purge the database from the pool? Is the behavior configurable, if so, where? Using JDBC driver with MySQL.


Solution

  • If a Connection test returns DATABASE_IS_INVALID, the pool is reset, meaning all outstanding Connections will be destroyed rather than reused when they are checked back in, and the pool will reconstitute itself with fresh, new Connections.