-
Notifications
You must be signed in to change notification settings - Fork 40
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
Can not access method result in condition closure #47
Comments
I don't understand the use case. Can you put together a more concrete example? |
Of course. @Cacheable(value = "dataServiceCache.vehicleByLabelAndCompanyId", condition = "#result != null") } Now, with version 4, I have no way to do it using the condition closure. Also, IMHO, I think it should be nice to keep this kind of compatibility with the previous version. |
This could help with transitioning to newer versions of Grails that use ehcache 3. Version 2 allows null values, but 3 does not. I think that Grails' |
The problem wasn't solved. If somebody came here with the same problem: solution that works for me is to override Ehcache.java file and add |
I have some cache conditions where the value can only be cached if the value is not null.
Apparently there is now way to do it in version 4, since the result of the method call can not be accessed inside the condition closure.
Before, I had the following condition: "#result != null", now I would need to rewrite it to something like
{ result != null }
The text was updated successfully, but these errors were encountered: