Any way to delete this topic? It seems that we have ui problem. That was definately DNN caching problem. Moderators please delete topic.
NHibernate version: Don't know included in castle RC3
I use windsor container from Castle. I use "Services" to fetch data from database. These services are accessed using WindsorContainer.Resolve<ServiceName>().<MethodName>() which actually uses either session.CreateQuery or criteria based data search and also Session.Load to fetch data by id.
The problem is that saving data works perfectly (records are altered, deleted or inserted into database and <set> many-to-many records are updated), but when I read data from database data for <set> <bag> or any other collection is returned the same as saved for all records i fetch instead of returning different data for different records.
My mapping files fragments:
Code:
...
<class name="Group" table="Group" lazy="false">
<id name="GroupID" column="GroupID" type="Int32" unsaved-value="0">
<generator class="native"/>
</id>
...
<set name="Sections" inverse="false" cascade="all-delete-orphan" table="Sections" lazy="false">
<key column="GroupID"/>
<many-to-many class="Section" column="SectionID" />
</set>
</class>
<class name="Section" table="Section" lazy="false">
<id name="SectionID" column="SectionID" type="Int32" unsaved-value="0">
<generator class="native"/>
</id>
<property column="name" type="String" name="Name" not-null="true" length="150" />
<set name="Groups" inverse="false" cascade="all-delete-orphan" lazy="false">
<key column="SectionID"/>
<many-to-many class="Group" column="GroupID" />
</set>
</class>
...
</hibernate-mapping>
So I get for Group class same records in Group.Sections set for different Group records.
Any idea what's wrong? I have suspiction that all this happens, because windsor creates singletons of services and caches them, so i have only one opened session. Is it problem? Do i need to close and reopen session again after saving for this to work?
--
Regards,
Dmitry