Just wondering if the following is expected behavior for LS4...
I have an entity that has some of its fields as part of a named aggregate - hence those fields are not loaded by default. I have set the entity to use the 2nd level cache.
If I issue an identity query for the entity without the aggregate name, the partial entity is retrieved and added to the 2nd level cache - as expected. However, if a subsequent query hits the 2nd level cache, the entity retrieved from the cache no longer supports lazy loading of the fields contained within the named aggregate - the fields just return null when accessed. It seems the entity is not being fully enlisted in the UnitOfWork.
PS. This previous forum entry seems to describe the same issue: http://www.mindscapehq.com/forums/thread/272823
Yes this does appear to be how it operates although I dont really consider this to be the right behavior so I will have a look at whats involved in updating this and then I will probably look at releasing this update via a compatibility flag to avoid breaking the current behavior for now.
I will let you know once I have looked in to making this update tomorrow.
I believe the current behavior is wrong, but it is the current behavior and has been this was since v1 so its for that reason I will be adding in the need for a compatibility flag for now to avoid any nasty surprises for anyone who is actually relying on this. We typically make these breaking changes more permanent when we rev the major version so I would look at switching it over proper for 5.0 :)
I have added in an update for this now and this will be available in the next nightly build. To make use of this you will need to enable the new EnableV5CacheBehavior compatibility flag on your context object. As mentioned, the intention will be to drop the need for this flag with 5.0.
Let me know once you have had a chance to grab the nightly and have a test with this.