-->
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: Heavy perfomance degradation when adding child to @OneToMany
PostPosted: Thu Jan 17, 2008 5:13 pm 
Newbie

Joined: Thu Jan 05, 2006 6:03 am
Posts: 9
Hi

i have a parent class Track which contains some thousands child instances of type Location:

------------------------
class Track {
...
@OneToMany(mappedBy = "track", fetch = FetchType.LAZY, cascade = CascadeType.ALL)
@OrderBy("timestamp ASC")
@OnDelete(action=OnDeleteAction.CASCADE)
public List<Location> getLocations() {
return locations;
}
}
------------------------


When i insert a new Location instance:

------------------------
track.addLocation(location);
em.persist(location);
return location.getLocationId();
------------------------


the EntityManager triggers thousands of selects for all sibling Location instances
until it finally inserts the new Location which slows down the DB layer
to some minutes for one insert.

What can i do?
Can i insert the Location natively or add some clever annotation?

Thanks
Marcel

Hibernate 3.2 cr2, jboss-EJB-3.0_RC9_Patch_1
PostgreSQL 8.1.5, Linux 2.6.18


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.