-->
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.  [ 8 posts ] 
Author Message
 Post subject: HB 2.1.b3(b) and order of objects during save()
PostPosted: Thu Oct 02, 2003 2:12 pm 
Beginner
Beginner

Joined: Sun Sep 14, 2003 10:54 am
Posts: 36
Hi,

It appears that HB 2.1.b3(b) allows objects to be sent to the db in the same order as objects were sent to save(). Is there something that needs to be configured to achive this? Currently, the order apears to be random.

Thanks


P.S. The abobe assumption was based on the code of IdentityMap.java that now uses org.apache.commons.collections.SequencedHashMap.


Top
 Profile  
 
 Post subject: order of deletes with multiple cascading deletes?
PostPosted: Thu Oct 02, 2003 2:47 pm 
Senior
Senior

Joined: Sun Aug 31, 2003 3:14 pm
Posts: 151
Location: Earth (at the moment)
Good question, I was just about to ask almost the same thing regarding deletes except with the twist that nothing has been explicitly deleted but simply removed from mulitple Collections on a parent.

How does one specify and order of operation for the actual database access?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 02, 2003 4:14 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Quote:
Is there something that needs to be configured to achive this?


No. It Just Happens.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 02, 2003 4:43 pm 
Beginner
Beginner

Joined: Sun Sep 14, 2003 10:54 am
Posts: 36
gavin wrote:
No. It Just Happens.


Does this mean that the order in which objects sent to db *cannot* be forced to be the same as the order in which they sent to save()?

It'd be really, really great (for me) if the above is not true since it kills performance when large sets of objects are involved.

I think it should be fixed ... actually, I thought that SequencedHashMap in the IdentityMap.java is to provide this ...

Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 02, 2003 4:47 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Quote:
Does this mean that the order in which objects sent to db *cannot* be forced to be the same as the order in which they sent to save()?


No it means that you are mistaken.


Top
 Profile  
 
 Post subject: Do I understand correctly?
PostPosted: Fri Oct 03, 2003 12:02 pm 
Senior
Senior

Joined: Sun Aug 31, 2003 3:14 pm
Posts: 151
Location: Earth (at the moment)
Dear Gavin,

If I understand correctly, the order in which calls are made to the DB matches the order in which calls are made to Session.save() et. al.?

What about when no explicit calls are made but objects are merely added and removed from persistent collections? Just to confirm, does this scenario require that I "might need to give a little hint" as per the FAQ for unique constraints?

Thank-you,
David


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 03, 2003 2:00 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Objects saved by cascade are saved in the order they were discovered by Hibernate's treewalking algorithm. So, in the case of a collection, it would be the iteration order of the collection.


Top
 Profile  
 
 Post subject: Sorry, let me clarify my question...
PostPosted: Sun Oct 05, 2003 5:51 pm 
Senior
Senior

Joined: Sun Aug 31, 2003 3:14 pm
Posts: 151
Location: Earth (at the moment)
Quote:
Objects saved by cascade are saved in the order they were discovered by Hibernate's treewalking algorithm. So, in the case of a collection, it would be the iteration order of the collection.


So in the case of several dfifferent collections on the same parent object if the instances in one collection are dependent upon those in another of the collections (I know this just begs the question why? ;) ) it is necessary to manually assist the order of inserting and deleting that occurs as Hibernate does not provide a mechanism in the mapping for saying "persist that collection before this one" correct?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 8 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.