Hibernate: Clean collection's 2nd level cache while cascade delete items
I have a problem Hibernate does not update 2nd level cache for a collection of items which are subject of cascade removal. Details Assume we have an object Parent which has Parent.myChildren collection of Child objects. Now we have also object Humans with Humans.myAllHumans collection and all Parent and Child objects are in that collection. Now we session.delete(parent) and all the children are cascade removed from the database, but Humans.myAllHumans collection's cache is not updated! It still assumes that cascade deleted objects are in database and we hit following exception while trying to