-->
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.  [ 3 posts ] 
Author Message
 Post subject: merge performance, and how it works
PostPosted: Wed Mar 09, 2011 6:41 am 
Newbie

Joined: Wed Mar 09, 2011 5:44 am
Posts: 4
Hi!

We works with Hibernate 3.3.2. We have an big entity tree. A big part of theese entitys are read only entitys, but thesee are fetched.
And if I call a merge it is very slow.

I suppose merge gets the root entity from cache or from db, and sets the detached object properties to the persistent entity tree.

If I set the bidirectional onetomany's other side the updatable=false and insertable=false. So I suppose merge calls merge to all fetched children of root entity.

Child entity
@ManyToOne(optional=false)
@JoinColumn(name="ID_APPLICATION", referencedColumnName="ID_APPLICATION", nullable=false, updatable=false, insertable=false)
public Application getApplication() {

Root entity (Application)

@OneToMany(mappedBy="application")
@OrderBy("maturityDate")
public java.util.List<RedemptionSchedule> getRedemptionList() {

If I remove the readonly children entitys from detached root entity, than it is more faster, but i'm affraid it's not a beautiful solution.

What is the better solution?

Thanks for all answer!

Hali


Top
 Profile  
 
 Post subject: Re: merge performance, and how it works
PostPosted: Wed Mar 09, 2011 6:50 am 
Expert
Expert

Joined: Thu Jan 08, 2009 6:16 am
Posts: 661
Location: Germany
You need to provide more info: on what objects do you call merge?
Do you have cascading enabled?

Please post some example code.

_________________
-----------------
Need advanced help? http://www.viada.eu


Top
 Profile  
 
 Post subject: Re: merge performance, and how it works
PostPosted: Wed Mar 09, 2011 7:08 am 
Newbie

Joined: Wed Mar 09, 2011 5:44 am
Posts: 4
I call merge only the root.

I didn't set any cascade on this read only properties.

But it's true. There is 3 properties on the root, what have CASCADE.ALL, but there aren't read only. And I haven't remove theese in my solution.

Thanks


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

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.