views:

39

answers:

1

There is a bug in Grails preventing me from using removeFrom* when the node I'm trying to remove is extending the collection 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.

+3  A: 

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
Pascal Thivent