Uploaded image for project: 'Karaf'
  1. Karaf
  2. KARAF-3562

DefaultJDBCLock case sensitive issue

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.3.9
    • 2.4.2, 3.0.4, 2.3.11, 4.0.0.M3
    • karaf
    • None

    Description

      There's a possible issue with:

       rs = getConnection().getMetaData().getTables(null, null, tableName, new String[] {"TABLE"});
      schemaExists = rs.next();
      

      in

      https://github.com/apache/karaf/blob/master/main/src/main/java/org/apache/karaf/main/lock/DefaultJDBCLock.java#L165-L167

      I'm using Postgres9.3 without any specific configuration.
      I have configured the locking mechanism to use the property karaf.lock.jdbc.table=KARAF_LOCK
      but Postgres stores the table name in its catalog in lowercase, so the query always returns a 0 length ResultSet.

      I couldn't find a short form in the JDBC api to ignore the case.

      I think this might be the default on Postgres, to convert it's catalog to lowercase, but I learn that this depends on the db configuration usually.

      So I suggest one of this possible options:

      • try both upper and lower case
      • improve logging to show which is table with the exact case that is checked
      • specialize PostgresJDBCLock if we can make the assumption that's pg default.

      And eventually improve Karaf docs to suggest trying to specify a lower case name in case of errors.

      Attachments

        Activity

          People

            jbonofre Jean-Baptiste Onofré
            paolo.antinori Paolo Antinori
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: