I have a user with a collection of addresses. i load the user by calling Session.Load(typeof(user), userKey). i then retrieve one of these addresses from the user.Addresses collection and call Session.Delete(address) on it within a transaction that is commited. it appears that user.Addresses still contains this deleted address. i believe this is because the address is now transient, but that it still exists in memory.
at this point, if i call Session.Load to reload the same user, i still see the same Addresses collection and it is only if i call Session.Evict(user) that i can then load a user with a address collection that reflects the data within the database
is my understanding correct and are any suggestions for a better way to have the user's address collection show up-to-date data?
|