Skip to content

Exclude data sets with output parameters from the implicit result cache - #2441

Merged
merks merged 1 commit into
eclipse-birt:masterfrom
raoulduke98:fix/2440-sp-outparam-cache
Jul 20, 2026
Merged

Exclude data sets with output parameters from the implicit result cache#2441
merks merged 1 commit into
eclipse-birt:masterfrom
raoulduke98:fix/2440-sp-outparam-cache

Conversation

@raoulduke98

Copy link
Copy Markdown

Fixes #2440

What

A data set that declares output parameters is now excluded from the implicit dataset result cache. After EngineExecutionHints.populateCachedDataSets has finalized the cached-candidate set, any data set whose design contains an IParameterDefinition with isOutputMode() is removed from it - mirroring the existing exclusion pass for extension-only filters directly below.

Why

The implicit result cache stores only rows. On a cache hit the engine substitutes dscache.DataSourceQuery, whose getOutputParameterValue(int/String) unconditionally returns null, so a stored-procedure data set (SPSelectDataSet) re-executed with the same parameter values within one render silently loses its OUT parameter values (rows stay correct). See #2440 for the full analysis and a minimal reproducing report design.

Excluding such a data set from the row cache is behavior-preserving: re-execution returns identical rows, only the caching optimization is lost - and it is required for correctness whenever a consumer reads outputParams["..."].

This targets the implicit cache path only; user-configured caching (getJVMDataSetCacheConfig) is not gated by needCacheDataSet and is out of scope for this issue.

Test

OutputParameterDataSetCacheTest registers two ODA data sets (one with an output parameter, one input-only control), each referenced by two queries so both become implicit-cache candidates, and asserts via IEngineExecutionHints.needCacheDataSet that only the input-only data set stays cached. Verified red/green: the test fails on the unpatched engine (the output-parameter data set is cached) and passes with this change, with the control assertion unaffected.

The cache stores only rows; on a cache hit the dscache DataSourceQuery
returns null output parameters, so stored-procedure data sets re-executed
with the same parameter values silently lose their OUT values.

Fixes eclipse-birt#2440
@merks

merks commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

@raoulduke98

We need you to complete the ECA to be able to merge your PR.

https://github.com/eclipse-birt/birt/blob/master/CONTRIBUTING.md#eclipse-contributor-agreement

@merks

merks commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

I verified that your new test runs:

https://ci.eclipse.org/birt/job/build/job/PR-2441/1/testReport/org.eclipse.birt.data.engine.api/OutputParameterDataSetCacheTest/

And @hvbtup has approved by virtue of his comment in the issue ; better would be to mark the review approval in the PR itself.

#2440 (comment)

So if we can get the ECA in place, I plan to merge this.

Thanks!!

@raoulduke98

Copy link
Copy Markdown
Author

thank you, eca is in place!

@merks
merks merged commit f9708ca into eclipse-birt:master Jul 20, 2026
3 checks passed
@merks

merks commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

The changes in in the latest nightly build now

https://download.eclipse.org/birt/updates/nightly/latest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Stored-procedure OUT parameters return null when the dataset result is cached

2 participants