Uploaded image for project: 'Jackrabbit Content Repository'
  1. Jackrabbit Content Repository
  2. JCR-3916

ConnectionFactory should use driver name to determine validation query



    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 2.11.1
    • None
    • jackrabbit-data
    • None


      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.


        1. JCR-3916.patch
          3 kB
          Christian Wolfe



            Unassigned Unassigned
            taidan19 Christian Wolfe
            0 Vote for this issue
            1 Start watching this issue