karaf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paolo Antinori (JIRA)" <j...@apache.org>
Subject [jira] [Created] (KARAF-3562) DefaultJDBCLock case sensitive issue
Date Wed, 25 Feb 2015 14:04:04 GMT
Paolo Antinori created KARAF-3562:
-------------------------------------

             Summary: DefaultJDBCLock case sensitive issue
                 Key: KARAF-3562
                 URL: https://issues.apache.org/jira/browse/KARAF-3562
             Project: Karaf
          Issue Type: Bug
          Components: karaf-core
    Affects Versions: 2.3.9
            Reporter: Paolo Antinori


There's a possible issue with:

{code}
 rs = getConnection().getMetaData().getTables(null, null, tableName, new String[] {"TABLE"});
schemaExists = rs.next();
{code} 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.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message