OFBIZ-13413 - Fix JdbcSQLDataException during startup caused by null table parameter in getPrimaryKeys#1229
Open
ashishvijaywargiya wants to merge 1 commit into
Open
Conversation
…tirely 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.
Contributor
|
Thanks Ashish, works perfectly |
Contributor
Author
Thank you, Sir! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixed: 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.