These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Hibernate mass up the index in a list
PostPosted: Thu Jun 14, 2007 4:03 am 
Newbie

Joined: Thu Jun 14, 2007 3:46 am
Posts: 17
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.