Description
Serhiy Shekhovtsov created an issue — 6th July 2015, 9:26:51:
During batch saving the method IsProcessedAfterAllAssociatedEntities is called and it calls GetHashCode of the associated Entity. At this moment DefaultLazyInitializer intercepts the call and fires ImmediateLoad for the associated proxy entity, which leads to entity fetching.
More details here.
Serhiy Shekhovtsov added a comment — 7th July 2015, 12:03:44:
As I figured out this is not related to batching and can be reproduced with a simplest example.
Serhiy Shekhovtsov added a comment — 8th July 2015, 9:23:15:
Complete and very basic sample can be downloaded here.
Summarizing it:
When using entities which do override the GetHashCode
and Equals
implementation, and use an identifier generator which does not trigger an immediate flush, saving many entities associated to uninitialized proxies causes the proxies to be loaded.
This reduces the usefulness of ISession.Load
.