Repository navigation
Keep stored procedure parameters for the life of the JDBC ODA connection - #2512
Merged
merks merged 1 commit intoNov 24, 2026
Merged
Conversation
CallStatement looked up the parameters of a procedure call with DatabaseMetaData.getProcedureColumns every time a statement was prepared and dropped them again in prepare(). A stored procedure data set that runs once per row of a table therefore repeated the dictionary lookup for every row. On Oracle, a report with 100 such rows ran 500 dictionary statements; with this change it runs 5, and the report time drops from about 20 s to 4 s. The ODA Connection now owns the lookups and hands them to the CallStatements it creates. The key holds the current schema, catalog, schema pattern and procedure name pattern. Only non-empty results from a lookup that completed are kept, so a procedure deployed later is still found, and callers get copies. The cache is cleared when the connection is opened or closed. Fixes eclipse-birt#2511
hvbtup
approved these changes
Nov 23, 2026
hvbtup
left a comment
Contributor
There was a problem hiding this comment.
Nice idea to cache this metadata.
wimjongman
reviewed
Nov 23, 2026
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the connection-scoped stored procedure parameter caching change.
No open issues 🎉
What changed in this PR
Addresses #2511 by retaining stored procedure parameter definitions for the lifetime of an ODA connection, reducing repeated JDBC dictionary lookups for datasets executed once per table row.
Changes:
- Shares a schema-aware parameter cache across regular and bidirectional call statements, clearing it when the connection opens or closes.
- Caches only non-empty, completed lookups and returns list copies, allowing empty or failed lookups to retry.
- Adds 14 stub-based tests covering reuse, connection lifecycle, schema changes, lookup failures, and package fallback.
| File | Description |
|---|---|
data/org.eclipse.birt.report.data.oda.jdbc/src/org/eclipse/birt/report/data/oda/jdbc/SPParameterCache.java |
Adds the shared cache with defensive list copies. |
data/org.eclipse.birt.report.data.oda.jdbc/src/org/eclipse/birt/report/data/oda/jdbc/Connection.java |
Owns the cache, supplies it to call statements, and clears it on open and close. |
data/org.eclipse.birt.report.data.oda.jdbc/src/org/eclipse/birt/report/data/oda/jdbc/CallStatement.java |
Reuses cached definitions and stores successful lookups using schema-aware keys. |
data/org.eclipse.birt.report.data.oda.jdbc.tests/test/org/eclipse/birt/report/data/oda/jdbc/CallStatementParameterCacheTest.java |
Adds database-independent regression coverage for caching behavior. |
Review effort: Balanced
merks
approved these changes
Nov 23, 2026
merks
left a comment
Contributor
There was a problem hiding this comment.
Unless I hear otherwise, I think it will be good to merge this very soon.
wimjongman
approved these changes
Nov 30, 2026
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.
Fixes #2511
What this changes
CallStatement looked up the parameters of a procedure call with DatabaseMetaData.getProcedureColumns every time a statement was prepared and dropped them again in prepare(). A stored procedure data set that runs once per row of a table repeated the dictionary lookup for every row.
The ODA Connection now owns a small cache (SPParameterCache) and hands it to the CallStatements it creates, including BidiCallStatement. The key holds the current schema (Connection.getSchema(), null for drivers that cannot tell), catalog, schema pattern and procedure name pattern.
Behaviour worth reviewing
Measurements (Oracle, ojdbc11 21.11, report from the issue, 100 rows, two runs each)
Tests
CallStatementParameterCacheTest, 14 tests on a stubbed JDBC connection (no database): reuse on one connection, statements open at the same time, another connection, close and reopen, reopen with another JDBC connection, close without closing the JDBC connection, changed schema, drivers without getSchema (SQLException, RuntimeException, AbstractMethodError), no schema, different procedures, empty result not kept, partial result after a failed lookup not kept, package.procedure retry, Bidi statements. 10 of the 14 fail without the change.
Not covered
No change to the order or the content of the lookups themselves.