Details
Description
There's a possible issue with:
rs = getConnection().getMetaData().getTables(null, null, tableName, new String[] {"TABLE"}); schemaExists = rs.next();
in
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.