I Have a Nhibernate object called Car, this Car object have a PersietentBag IList collection called Doors, all in lazy loading.
if i do (IN SESSION 1)
int singleDoor = Car.Doors[0];
the lazyest collections loads from db and the related objects becomes added to the first level cache, the i will have in the 1rst level cache N objects Car and N Doors loaded from db.
From another hand (at other part of the code IN SESSION 2) i loads the same Car objects and do the same assigment
int singleDoor = Car,Doors[0];
and i Evicts Car and all the Door(s) objects from SESSION2
i modify the state of this objects and want to attach the doscontected objects tu the SESSION1 for save nd do
mySession.Update(Car);
But when i try to update the Door(s) obejcts obviously i have the (an other obejct with the same id, etc) exception is thrown because there's yet another object with the same id.
Bot it's dificult to find the old object to evict, how can i EVICT the old objects or clear the 1rst level cache (only by type and id) or discard old objects from cache and update what i want?.
thanks in advance.