cuba-platform / cuba

CUBA Platform is a high level framework for enterprise applications development
https://www.cuba-platform.com
Apache License 2.0
1.34k stars 219 forks source link

Use Query Cache for separate loading queries during entity fetching #3287

Open dtaimanov opened 2 years ago

dtaimanov commented 2 years ago

See forum topic to find reproducible case.

Problem

Separate loading of collection attribute (org.eclipse.persistence.internal.indirection.QueryBasedValueHolder#instantiate(...):147) does not use Query Cache. When entity loaded with cached query, and further loading occurs during fetching according to view, nested entities loaded by not cached queries. It leads to repetitive loadings of entity graphs for each cached query if they are not subsequent.

Proposition

Investigate the possibility of "cached" property propagation for "nested" (fetching) queries in value holders. Or rework fetching mechanism for cached queries to perform "nested" queries manually with "cached" flag, but not through QueryBasedValueHolder