Closed
Description
Lukasz created an issue — 22nd February 2016, 11:36:30:
Reproductions Steps:
- Enable second level cache in nh configuration.
- Create entity with collection.
- Enable second level cache on collection (on collection entity also ofc).
- Open session.
- Create QueryOver (Criteria or HQL) which fetch root entities with children collections using left outer join with some restrictions on collection.
E.g.firstSession.QueryOver<Customer>() .JoinAlias(n => n.Orders, () => ordersAlias, JoinType.LeftOuterJoin, Restrictions.Eq("Number", orderNumber)) .List();
- Open another session.
- Create QueryOver on second session for all root entities. E.g.
secondSession.QueryOver<Customer>().List();
- Iterate over entities fetched in point 7. and fetch child collections.
- All collection fetched in point 8. Will be filtered like in point 5.
Lukasz added a comment — 23rd February 2016, 13:08:49:
Pull request with tests and fix for Criteria and QueryOver: #460
Lukasz added a comment — 24th February 2016, 14:01:27:
Pull request with tests and fix for HQL: #463
Alexander Zaytsev added a comment — 7th April 2017, 1:37:44:
<~Lukasz> your pull request(s) do not consider 2 separate fetches. When there is a collection with restrictions and another one without then I expect that the collection without restrictions would be cached.
So, the property "CanAddCollectionsToCache" shall probably be a dictionary.