Skip to content

Second level cache (still?) not working for inherited domains #14349

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
dbaylerg opened this issue May 1, 2023 · 13 comments
Open

Second level cache (still?) not working for inherited domains #14349

dbaylerg opened this issue May 1, 2023 · 13 comments

Comments

@dbaylerg
Copy link

dbaylerg commented May 1, 2023

I am still having an issue with the Second Level Cache not working for inherited domains.

I have put together a sample project which demonstrates the issue as I see it, or perhaps I have configured something incorrectly.

https://github.com/dbaylerg/GormCacheIssue

The project was created with Grails 4.0.13 with updated dependencies to include the latest fixes from grails/grails-data-hibernate5#483

What I am seeing is that my inherited domains still are not cached. Any help or suggestions would be appreciated.

@dbaylerg
Copy link
Author

dbaylerg commented May 4, 2023

I believe I included the fix for https://github.com/grails/gorm-hibernate5/issues/655 but they may still be related. The difference is that in my example I do not use an abstract parent class.

@purpleraven
Copy link
Contributor

@dbaylerg as I can see my fix not in released version

@dbaylerg
Copy link
Author

@purpleraven I looked at the commit & release history for the 7.0.x branch and it looks to me that it was included in org.grails.plugins:hibernate5 7.0.7 release.

7.0.6 was released on Jan 12, 2022, your fix was committed on Jan 19th, 2022, and 7.0.7 was released on Dec 20, 2022.

Am I looking at the wrong branch?

image

@purpleraven
Copy link
Contributor

purpleraven commented Jun 22, 2023

@dbaylerg the fix presents in the 7.0.x branch, but not in 7.1.x and higher.

@puneetbehl Should I create a PRs for another branches?

https://github.com/grails/gorm-hibernate5/pull/483/files

@dbaylerg
Copy link
Author

@purpleraven @puneetbehl

First of all, thank you, I appreciate the responses but somehow we seem to be talking about different versions.

My test application is built and tested with the dependency
compile "org.grails.plugins:hibernate5:7.0.7"

So, I believe I am testing with the 7.0.x branch not the 7.1.x branch. The fix for bug #483 appears to included in the 7.0.7 version but does not seem to fix the issue.

If I am mistaken about this I would appreciate if you can point out what I am missing or got wrong.

@purpleraven
Copy link
Contributor

I have fixed just one of case.
For make it work you have to add mapping cache property to base class.

@dbaylerg
Copy link
Author

@purpleraven All of the classes, both base class and sub-classes, have

static mapping = {
    cache true
}

@purpleraven
Copy link
Contributor

purpleraven commented Jun 22, 2023 via email

@dbaylerg
Copy link
Author

@purpleraven The test application is linked above but here it is https://github.com/dbaylerg/GormCacheIssue

@dbaylerg
Copy link
Author

@purpleraven Any news on this issue?

@purpleraven
Copy link
Contributor

@dbaylerg no, vacation time...

@dbaylerg
Copy link
Author

dbaylerg commented Oct 2, 2024

@purpleraven It has been awhile but I thought I would check in one last time before abandoning hope for an official fix.

@jamesfredley jamesfredley moved this to Todo in Grails 7 Oct 2, 2024
@purpleraven
Copy link
Contributor

@dbaylerg I really forgot about the case. Sorry.

@jdaugherty jdaugherty transferred this issue from grails/grails-data-hibernate5 Mar 13, 2025
@jdaugherty jdaugherty transferred this issue from apache/grails-data-mapping Apr 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants