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: SaveOrUpdate & select-before-update
PostPosted: Mon May 14, 2007 11:36 pm 
Beginner
Beginner

Joined: Wed May 02, 2007 12:24 am
Posts: 41
I've seen several posts on this topic with any repsonses...maybe I'm not doing my search properly.

Here is the situation. I have a class that has a bunch of collections. I've defined my mapping so that lazy=false, select-before-update=true.

I load my instance (works great!). I add a new row to one of the collections. Then using a new session I call SaveOrUpdate. It actually does save everyhting...but I was looking at the sql, and realized that it is deleting all the rows in the collection from the db and then reinserting them.

Also it was updating all the exiting associations, I hadn't changed anything...

1. Is this normal behavior?
2. I have an intercepter that updates the audit fields (lastUser, lastModifiedDt) on: OnFlushDirty, OnSave? Could that be confusing nHibernate?

If this is not the normal behavior, how should I proceed?

Thank you!


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 20, 2007 5:23 am 
Beginner
Beginner

Joined: Thu Oct 26, 2006 4:45 am
Posts: 39
Depends if your collections are mapped as bags or sets.
How are your collections mapped? Should we guess your hibernate-mappingfiles or are you willing to shed some more light?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 20, 2007 2:47 pm 
Hibernate Team
Hibernate Team

Joined: Tue Jun 13, 2006 11:29 pm
Posts: 315
Location: Calgary, Alberta, Canada
1. It is normal behavior if your collection is a bag
2. I don't believe it has anything to do with the interceptor; nor does it have anything to do with select-before-update.

I answer a similar post yesterday, see:
http://forum.hibernate.org/viewtopic.ph ... t=#2356166

Hope this helps.

_________________
Karl Chu


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.