Hibernate uses its query spaces to decide when to flush and which parts of the cache to invalidate. Make sure to set them for native queries.