I try to create a list and that works. But sometimes hibernate make a mess of the index in the list. At leats that's what i see in the database. records in the samelist with the same index.
So when i reboot the application the list is "not valid" any more and i really need that index. The problem is that it happens sometimes and sometimes i goes right. somebody an idea?
Hibernate version: 1.2
Mapping documents:
<list name="Items" inverse="false" lazy="false" > <!-- when i use inverse true it never works -->
<key column="PlaylistPeriodId" />
<index column="Position" />
<one-to-many class="DStudioObject.NHibernate.Objects.PlaylistItem, DStudioObject" />
</list>
<many-to-one name="Period" class="DStudioObject.NHibernate.Objects.PlaylistPeriod, DStudioObject" column="PlaylistPeriodId" update="true" insert="true" lazy="false" />
Code between sessionFactory.openSession() and session.close():
Code:
item.Period = _activeplaylistperiod;
//evt positie ook hard opgeve?
_playlistmanager.saveOrUpdateObject(item);
_activeplaylistperiod.Items.Insert(position, item);
//_playlistmanager.saveOrUpdateObject(_activeplaylistperiod);
//_playlistmanager.reload(item);
//_playlistmanager.reload(_activeplaylistperiod);
here i try different combinations. there for some rules are comment.
Name and version of the database you are using:
Mysql 5