Hi all,
I just ran into a very strange problem concerning caching. It appears with both EHCache as well as OSCache so I guess it's Hibernate-related. However I'm not versed in the inner workings of the caching mechanism as it always has been something that just worked, so I hope that someone can illuminate me on what's going on.
Given the following query:
Code:
SELECT title.versions FROM CopyrightTitle title WHERE title.worknumber=:worknumber OR :worknumber IN ELEMENTS(title.additionalWorknumbers)
If I enable caching, the first run yields the correct result but any subsequent calls will return a list containing a null element.
Now when I rewrite the query to select the whole title object and then use title.getVersions() in my method, everything works as expected. I haven't specified a fetch strategy on the @OneToMany relation so it should be eagerly fetched.
All the best
Marcus