-->
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: Performance of a cascade save/update vs saving other side
PostPosted: Thu Sep 01, 2005 12:12 am 
Newbie

Joined: Fri Jan 30, 2004 12:56 am
Posts: 5
Location: Salt Lake City
We have a class named Consumer:

Code:
<class name="Consumer" table="tbl_consumer">
    <id name="id" column="id" type="integer">
   <generator class="native"/>
    </id>
    ....
    ....
   <set name="consumerEpisodes"
      inverse="true"
      lazy="true"
      cascade="all-delete-orphan" >
      <key column="consumer_id" />
      <one-to-many    class="domain.ConsumerEpisode"/>
   </set>
   ....
   ....


The Consumer class contains a number of <set mappings, just like the one shown above. We use a web architecture where the Consumer is often detached (while in the view layer)and we add instances to the contained Sets (e.g adding a new consumerEpisode).

The question is as follows. In our arhitecture (uses transactional Service objects that calls DAOs) I can 1) call saveorupdate on the Consumer and relie on Hibernate finding the transient instances in the Set or 2) create methods to save the transient instances ( eg consumerEpisode) by itself. Is there a perfomance penalty to having Hibernate do this work(figuring out which instances in the set are transient and saving them) and if so how much of a penalty.

I have combed through the docs, but I'm still uncertain. Any insight will be much appreciated.
Code:


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.