-->
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: Object's Unsave value
PostPosted: Mon Dec 04, 2006 11:34 am 
Beginner
Beginner

Joined: Fri May 12, 2006 10:48 am
Posts: 33
Hi everybody.
I’ve been working with NHibernate in a really big project and nowadays I’m having some problems with transactions, I’ve made some tests and I found a possible solution using two sessions, with the first one I access to the database out of the transaction, the second one is the session I use to persist object within the transaction, but, finally, I’ve found a new problem, when I’m working with objects witch Id unsaved value is cero my alternative solution works OK, but, when I’m working with object witch Id unsaved value is Any, NHibernate tries to insert a new row instead of updating someone.

Can somebody help me with my problem?
Or, Can somebody give me some explanation about how NHibernate knows when insert a new row or update someone?

Thanks, Martín


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 04, 2006 1:45 pm 
Senior
Senior

Joined: Sat Mar 25, 2006 9:16 am
Posts: 150
You can use an interceptor to implement your own IsUnsaved logic.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 04, 2006 3:34 pm 
Beginner
Beginner

Joined: Fri May 12, 2006 10:48 am
Posts: 33
Thanks grennis

Do you have any example?

Martin


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.