| I have enabled the auto_evict_collection_cache property but when I do update on the many-to-one side(eg User), and its relation is null it throws an exception. public class User { String name; @ManyToOne(fetch = FetchType.LAZY) Company company; } public class Company { @OneToMany(fetch = FetchType.LAZY, mappedBy = "company") @Cache(usage = CacheConcurrencyStrategy.READ_WRITE) List<User> users = new ArrayList<User>(); } Caused by: org.hibernate.TransientObjectException: The instance was not associated with this session at org.hibernate.internal.SessionImpl.getIdentifier(SessionImpl.java:1570) at org.hibernate.cache.internal.CollectionCacheInvalidator.evictCache(CollectionCacheInvalidator.java:122) ... 29 more |