|
When I use the auto_evict_collection_cache property and persist a new entity. Hibernate doesn't cache the next read operation.
e.g. Company company = new Company( 1 ); session.persist(company);
company = otherSession.get(Company.class, 1); Hibernate.initialize(company.getUsers());
After that if I read inside the cachemanager there isn't any value cached session = openSession(); key = cache.generateCacheKey( 1, persister, sessionFactory(), session.getTenantIdentifier() ); cachedValue = cache.get( session, key, session.getTimestamp() ); assertNotNull( "Collection wasn't cached", cachedValue );
|