Hi,
Using NHibernate 2.1 on mssql with C#.
I have 2 diffrent classes witch use an "group" object.
<class name="OrderCode" table="OrderCode" polymorphism="explicit">
<id name="Id" column="ID">
<generator class="native" />
</id>
...
<many-to-one class="Group" name="Group" column="GRUPPE" cascade="all" />
...
and
<class name="Alotment" table="Alotment">
<id name="Id" column="ID">
<generator class="native" />
</id>
...
<many-to-one class="Group" name="Group" column="GRUPPE" cascade="all" />
...
An import script now creates first the OrderCode and select the group, if the group not exist it makes an new one. Later in the same script I create the alotment. Same way, select if there is the right group, if not the script create a group.
Sometimes OrderCode and Alotment need the same group, but if the group dosen't exist, the script creates two groups cause the secend select don't get the group out off the session.
I know its the same session. Is there a way to let IQuery, ICriteria or Session.Linq select not commit groups out of the session?