HHH-8250 - fix for collection caching, sql query was executed even if collection was found in cache 

If trace logging was enabled it worked corectly.