Details
-
Bug
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
2.11.1
-
None
-
None
Description
Currently, the guessValidationQuery method in the ConnectionFactory class uses the JDBC URL to determine which database is being used (and thus what syntax to use for the validation query for the connection pool).
This approach should work in most cases, but it could potentially fail if the server's hostname contains the name of a database within it.
For example, say your team has a server with an Oracle database used for testing, named oracle-1.company.com. And let's say you decide to install a PostgreSQL instance on oracle-1 to use for additional testing. The JDBC URL would look something like jdbc:postgresql://oracle-1.company.com/database.
In its current state, guessValidationQuery would guess that this is an Oracle database, and would use the wrong validation query.
One solution to this would be to instead use the name of the JDBC driver class to determine which database is being used.
I have a patch for this solution, but it only changes the class. I haven't been able to figure out how to refactor the tests in any way that would be clean and easy.