diff --git a/framework/entity/src/main/java/org/apache/ofbiz/entity/jdbc/DatabaseUtil.java b/framework/entity/src/main/java/org/apache/ofbiz/entity/jdbc/DatabaseUtil.java index 595cece9f36..2ace7d39fbb 100644 --- a/framework/entity/src/main/java/org/apache/ofbiz/entity/jdbc/DatabaseUtil.java +++ b/framework/entity/src/main/java/org/apache/ofbiz/entity/jdbc/DatabaseUtil.java @@ -1228,20 +1228,12 @@ private Map> getColumnInfo(Set tabl // first try getting all at once for databases that support that and can generally perform WAY better, if that fails get one at // a time so it will at least work - try (ResultSet rsPks = dbData.getPrimaryKeys(null, lookupSchemaName, null)) { + try (ResultSet rsPks = dbData.getPrimaryKeys(null, lookupSchemaName, "%")) { pkCount += checkPrimaryKeyInfo(rsPks, lookupSchemaName, needsUpperCase, colInfo, messages); } catch (Exception e1) { - Debug.logInfo("Error getting primary key info from database with null tableName, will try other means: " + e1.toString(), + Debug.logInfo("Error getting primary key info from database with % tableName, will try other means: " + e1.toString(), MODULE); } - if (pkCount == 0) { - try (ResultSet rsPks = dbData.getPrimaryKeys(null, lookupSchemaName, "%")) { - pkCount += checkPrimaryKeyInfo(rsPks, lookupSchemaName, needsUpperCase, colInfo, messages); - } catch (Exception e1) { - Debug.logInfo("Error getting primary key info from database with % tableName, will try other means: " + e1.toString(), - MODULE); - } - } if (pkCount == 0) { Debug.logInfo("Searching in " + tableNames.size() + " tables for primary key fields ...", MODULE); for (String curTable : tableNames) {