First of all, thanks.
You are right, but I need a parent referece and a references on all children, parts of maping files are:
Workspace: <bag name="AppUserList" inverse="true" table="app_user" lazy="true" cascade="all" >
<key column="workspace_id" />
<one-to-many class="Accordia.DataLayer.Configuration.AppUser,DataLayer" />
</bag>
AppUser: <many-to-one name="workspaceId" column="workspace_id" class="Accordia.DataLayer.Configuration.Workspace, DataLayer" />
The idea is to read user (witch have a referece to parent) in one session, than close that session, at this time user (from the code from last post) is detach, then open second session in the second session I bring that user (let say that a as a function return, like a code form last post), and that make some minor changes and THAN simply update user. This is a most common thing to do, I need that all the time, I tried with a sess.Lock(...) but it constantly saying the a workspace (parent of a user) is transistient object and that need to be saved, that is unacceptable for me.
Note: My english is not so goog, I hope that you understand what I'm trying to say.
|