This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
i make a new uow and get an en entity called user. each user have the dependence called contract After load user i save this entity to memory and keep it on all extent session at first time all works fine. but next time i get the cached contracts.
how can i clean a depended entites? |
|
|
In your example how does User get assigned? Is it persisted between calls for the above code? If so then the loaded JContracts will be persisted across calls as well so you will be adding the same set of data every time you call the above code. Is that the problem you are seeing?
|
|
|
Yes, user is persisted. Thanks a lot Jeremy. |
|
|
If you want to load the JContacts independantly on each call you should avoid attaching the User (since this will in turn attach the loaded JContact entities in its child collection) and simply make a call to fetch all JContacts where the UserId == User.Id to fetch them from the database within the current UnitOfWork scope.
|
|