[
https://issues.apache.org/jira/browse/JCR-3916?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Christian Wolfe updated JCR-3916:
---------------------------------
Status: Open (was: Patch Available)
> ConnectionFactory should use driver name to determine validation query
> ----------------------------------------------------------------------
>
> Key: JCR-3916
> URL: https://issues.apache.org/jira/browse/JCR-3916
> Project: Jackrabbit Content Repository
> Issue Type: Bug
> Components: jackrabbit-data
> Affects Versions: 2.11.1
> Reporter: Christian Wolfe
> Priority: Minor
>
> 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.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)