-->
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: Experience in merge strategies
PostPosted: Tue Feb 14, 2006 9:57 am 
Beginner
Beginner

Joined: Tue Nov 30, 2004 6:19 am
Posts: 29
Location: Germany
Hi,

I'm currently thinking about strategies for merging object areas in a object graph in a 3-tier environment (third tier may not have Hibernate dependencies; areas are connected by hibernate cascade all). From my point of view, there are three different merge strategies:

  1. Reattach the cascade root with saveOrUpdate - works in every case but with worst performance (writing all the objects each time).
  2. Reattach the cascade root with merge - works fine if the domain model and cascading is implemented well. merge() reads every object from database and writes only the detected changes. So it should perform better in comparison to saveOrUpdate, mentioned above.
  3. Reattach 'manually' without hibernate cascading support - reattach every object 'manually' using plain lock/save/update. A possible way to implement this strategy, is to use a changed flag, demarked by class and ID and use a visitor pattern with save-, delete- and detach- and reattach-visitors. I would expect the best performance here.

My questions are,
  • is there an additional merge strategy anywhere out there?
  • what's your experience using the above merge strategies?



Best regards,
Micha


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.