There is a bug in Grails preventing me from using removeFrom* when the node I'm trying to remove is extending the 开发者_如何学Ccollection type. Removing the node directly from the association won't update the second level cache.
A hasMany B
Is there any way to manually invalidate or force a reload on an association cache? Invoking refresh() on the many side didn't do the trick.
If you have access to the SessionFactory
instance, you could use evictCollection
:
sessionFactory.evictCollection("Cat.kittens", catId); //evict a particular collection of kittens
sessionFactory.evictCollection("Cat.kittens"); //evict all kitten collections
精彩评论