From 543e3da28dba023526d39efe5f5c7151b2241ca3 Mon Sep 17 00:00:00 2001 From: Ashish Vijaywargiya Date: Sun, 17 May 2026 09:11:00 +0530 Subject: [PATCH 1/4] Adding the latest stable version of H2 database. The ./gradlew cleanAll loadAll is getting completed in 56 seconds for me. So I will say the latest version is faster than the previous version. - runtimeOnly 'com.h2database:h2:2.2.224' + runtimeOnly 'com.h2database:h2:2.4.240' 2026-05-16 23:54:23,778 |main |JobPoller |I| Shutting down JobPoller. 2026-05-16 23:54:23,778 |OFBiz-JobPoller |JobPoller |I| JobPoller thread started. 2026-05-16 23:54:23,778 |main |JobPoller |I| JobPoller shutdown completed. 2026-05-16 23:54:23,778 |OFBiz-JobPoller |JobPoller |I| JobPoller thread stopped. 2026-05-16 23:54:23,778 |main |ServiceContainer |I| Removing from cache dispatcher: entity-default 2026-05-16 23:54:23,778 |main |ServiceDispatcher |I| De-Registering dispatcher: entity-default 2026-05-16 23:54:23,778 |main |ServiceDispatcher |I| Shutting down the service engine... 2026-05-16 23:54:23,778 |main |ContainerLoader |I| Stopped container service-container 2026-05-16 23:54:23,778 |main |ContainerLoader |I| Stopping container component-container 2026-05-16 23:54:23,778 |main |ContainerLoader |I| Stopped container component-container 2026-05-16 23:54:23,778 |xer_default_products |DocumentIndexer |I| DocumentIndexer_default_products: indexed Lucene document: productId:dropShip3 2026-05-16 23:54:23,779 |xer_default_products |DocumentIndexer |I| DocumentIndexer_default_products: indexed Lucene document: productId:dropShip3 > Task :loadAll [Incubating] Problems report is available at: file:///Users/ashish/ofbiz-dev/ofbiz-trunk/build/reports/problems/problems-report.html Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0. You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins. For more on this, please refer to https://docs.gradle.org/8.14.5/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation. BUILD SUCCESSFUL in 56s 38 actionable tasks: 24 executed, 14 up-to-date ashish@Ashish-Vijaywargiya ofbiz-trunk % ./gradlew cleanAll loadAll --- dependencies.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dependencies.gradle b/dependencies.gradle index 136541b170..f1ae178360 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -97,7 +97,7 @@ dependencies { runtimeOnly 'org.apache.avalon.framework:avalon-framework-impl:4.3.1' runtimeOnly 'org.apache.axis2:axis2-transport-http:1.8.2' runtimeOnly 'org.apache.axis2:axis2-transport-local:1.8.2' - runtimeOnly 'com.h2database:h2:2.2.224' + runtimeOnly 'com.h2database:h2:2.4.240' runtimeOnly 'org.apache.geronimo.specs:geronimo-jaxrpc_1.1_spec:2.1' runtimeOnly 'org.apache.logging.log4j:log4j-1.2-api:2.25.4' // for external jars using the old log4j1.2: routes logging to log4j 2 runtimeOnly 'org.apache.logging.log4j:log4j-jul:2.25.4' // for external jars using the java.util.logging: routes logging to log4j 2 From 6dd1d6aa5ba9cc9149227f04dcbf9bfa907a4dd1 Mon Sep 17 00:00:00 2001 From: Ashish Vijaywargiya Date: Tue, 19 May 2026 15:38:27 +0530 Subject: [PATCH 2/4] OFBIZ-13413 - Here is the fix to remove the null parameter attempt entirely and use the "%" wildcard as our primary optimization path. This preserves performance for databases that accept wildcards, while allowing strict databases to silently return zero rows and gracefully fall back to compliant table-by-table iteration without polluting the logs with stack traces. While some database drivers tolerate a null argument here, the official JDBC specification mandates that this parameter must be an exact table name. Because H2 enforces this specification strictly, it throws an exception before OFBiz eventually catches it and falls back to querying tables individually. This commit will fix the following error/warnings returned on the console: 2026-05-17 23:51:35,252 |OFBiz-batch-2 |DatabaseUtil |I| Getting Column Info From Database 2026-05-17 23:51:35,252 |OFBiz-batch-1 |DatabaseUtil |I| Error getting primary key info from database with null tableName, will try other means: org.h2.jdbc.JdbcSQLDataException: Invalid value "null" for parameter "table" [90008-240] 2026-05-17 23:51:35,252 |OFBiz-batch-1 |DatabaseUtil |I| Searching in 7 tables for primary key fields ... 2026-05-17 23:51:35,252 |OFBiz-batch-1 |DatabaseUtil |I| Reviewed 9 primary key fields from database. 2026-05-17 23:51:35,253 |OFBiz-batch-3 |DatabaseUtil |I| Error getting primary key info from database with null tableName, will try other means: org.h2.jdbc.JdbcSQLDataException: Invalid value "null" for parameter "table" [90008-240] 2026-05-17 23:51:35,253 |OFBiz-batch-3 |DatabaseUtil |I| Searching in 6 tables for primary key fields ... 2026-05-17 23:51:35,253 |OFBiz-batch-3 |DatabaseUtil |I| Reviewed 8 primary key fields from database. 2026-05-17 23:51:35,268 |OFBiz-batch-2 |DatabaseUtil |I| Error getting primary key info from database with null tableName, will try other means: org.h2.jdbc.JdbcSQLDataException: Invalid value "null" for parameter "table" [90008-240] 2026-05-17 23:51:35,268 |OFBiz-batch-2 |DatabaseUtil |I| Searching in 870 tables for primary key fields ... 2026-05-17 23:51:35,274 |OFBiz-batch-2 |DatabaseUtil |I| Reviewed 1697 primary key fields from database. --- .../org/apache/ofbiz/entity/jdbc/DatabaseUtil.java | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) 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 595cece9f3..2ace7d39fb 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) { From 30b479c7c57b24c4b01e5ad84fb2d6fac472bc7f Mon Sep 17 00:00:00 2001 From: Ashish Vijaywargiya Date: Tue, 19 May 2026 15:55:06 +0530 Subject: [PATCH 3/4] Revert "OFBIZ-13413 - Here is the fix to remove the null parameter attempt entirely and use the "%" wildcard as our primary optimization path. This preserves performance for databases that accept wildcards, while allowing strict databases to silently return zero rows and gracefully fall back to compliant table-by-table iteration without polluting the logs with stack traces." This reverts commit 6dd1d6aa5ba9cc9149227f04dcbf9bfa907a4dd1. --- .../org/apache/ofbiz/entity/jdbc/DatabaseUtil.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) 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 2ace7d39fb..595cece9f3 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,12 +1228,20 @@ 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, "%")) { + try (ResultSet rsPks = dbData.getPrimaryKeys(null, lookupSchemaName, null)) { 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(), + Debug.logInfo("Error getting primary key info from database with null 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) { From c9ff8a38a3b813290184028425ad9b1821f9d43e Mon Sep 17 00:00:00 2001 From: Ashish Vijaywargiya Date: Tue, 19 May 2026 16:25:03 +0530 Subject: [PATCH 4/4] OFBIZ-13413 - Here is the fix to remove the null parameter attempt entirely and use the "%" wildcard as our primary optimization path. This preserves performance for databases that accept wildcards, while allowing strict databases to silently return zero rows and gracefully fall back to compliant table-by-table iteration without polluting the logs with stack traces. While some database drivers tolerate a null argument here, the official JDBC specification mandates that this parameter must be an exact table name. Because H2 enforces this specification strictly, it throws an exception before OFBiz eventually catches it and falls back to querying tables individually. This commit will fix the following error/warnings returned on the console: 2026-05-17 23:51:35,252 |OFBiz-batch-2 |DatabaseUtil |I| Getting Column Info From Database 2026-05-17 23:51:35,252 |OFBiz-batch-1 |DatabaseUtil |I| Error getting primary key info from database with null tableName, will try other means: org.h2.jdbc.JdbcSQLDataException: Invalid value "null" for parameter "table" [90008-240] 2026-05-17 23:51:35,252 |OFBiz-batch-1 |DatabaseUtil |I| Searching in 7 tables for primary key fields ... 2026-05-17 23:51:35,252 |OFBiz-batch-1 |DatabaseUtil |I| Reviewed 9 primary key fields from database. 2026-05-17 23:51:35,253 |OFBiz-batch-3 |DatabaseUtil |I| Error getting primary key info from database with null tableName, will try other means: org.h2.jdbc.JdbcSQLDataException: Invalid value "null" for parameter "table" [90008-240] 2026-05-17 23:51:35,253 |OFBiz-batch-3 |DatabaseUtil |I| Searching in 6 tables for primary key fields ... 2026-05-17 23:51:35,253 |OFBiz-batch-3 |DatabaseUtil |I| Reviewed 8 primary key fields from database. 2026-05-17 23:51:35,268 |OFBiz-batch-2 |DatabaseUtil |I| Error getting primary key info from database with null tableName, will try other means: org.h2.jdbc.JdbcSQLDataException: Invalid value "null" for parameter "table" [90008-240] 2026-05-17 23:51:35,268 |OFBiz-batch-2 |DatabaseUtil |I| Searching in 870 tables for primary key fields ... 2026-05-17 23:51:35,274 |OFBiz-batch-2 |DatabaseUtil |I| Reviewed 1697 primary key fields from database. --- .../org/apache/ofbiz/entity/jdbc/DatabaseUtil.java | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) 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 595cece9f3..2ace7d39fb 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) {