I want to do it in one session. Nexus has right.I only need to evict my object before editing. When object is saved by the user, then I'm doing session.SaveOrUpdate on it, but when user cancels the operation, I'm doing Session.Get, to reload my object (that was evicted) to state before evicting.
I have one instance of UOW per thread. And one instance of UOW uses one session. Thanks for the answers. Chris. On 15 Mar, 10:38, Oskar Berggren <[email protected]> wrote: > 2010/3/15 General <[email protected]>: > > > So what can I do to edit my Contractor object in separated area? I > > can't create a new session to do that, because I will receive an > > exception informing me that there are two objects in different > > sessions with the same Id. > > Are you sure you got that correctly? Creating session A and session B, > then doing A.Get(4) and B.Get(4) should give you two distinct objects > in memory, each held by one session, and no exception. So there must > be something more complicating your situation? > > /Oskar -- You received this message because you are subscribed to the Google Groups "nhusers" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/nhusers?hl=en.
