Domain subclass does not inherit caching from parent
- Dominant language
- Groovy
- Stars
- 2.9k
- Forks
- 975
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 92
Description
In grails 2, applying cache true in a parent domain class's mapping block would propagate 2nd level caching through to the child domains, this is not the case with grails 4.
This results in attempted retrievals and misses from the cache for the child domain.
The linked sample project displays this behaviour by setting up a Parent and Child domain & calls to both dynamic finder and criteria queries through loading of the index page.
The logged session statistics show that the domain details never seem to be put into the cache.
A non-abstract domain (StandardThing) is also configured to ensure the correct behaviour which can be accessed through the relevant URI.
Sample app
https://github.com/leadtrip/grail4AbstractCache
Contributor guide
Research direction
Start with the linked sample app and its Parent, Child, and StandardThing domain classes. Reproduce the dynamic finder and criteria queries from the index page while checking the logged session statistics. Done means child-domain details are cached and subsequent retrievals no longer miss as described.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- groovy
- Domain
- backend, databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100