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.  [ 5 posts ] 
Author Message
 Post subject: Object is not being saved
PostPosted: Mon Jul 10, 2006 11:50 am 
Regular
Regular

Joined: Sun Feb 12, 2006 10:18 pm
Posts: 60
Location: Rosario, Argentina
I have a class named "User", this class has a one-to-one relationship with a class "Person". Yet, it has a regular string property, wich I'm trying to update (not touching the "Person" property), but when I call SaveOrUpdate(), it does nothing. In sessionImpl.cs:

Code:
EntityEntry e = GetEntry( theObj );
if( e != null && e.Status != Status.Deleted )
{
    // do nothing for persistent instances
    log.Debug( "SaveOrUpdate() persistent instance" );
}


When I debug, the "if" condition result is true, so NHibernate explicitelly says it won't do anything. Why is this?

I mentioned the Person property because it's this property the one in charge of originally creating the User instance, but in an independent earlier stage, and it does so perfectly.

Help. please...
Alejandro.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 10, 2006 12:13 pm 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
SQL is only executed on Flush() which is called automatically on transaction commit and also before queries.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 10, 2006 1:45 pm 
Regular
Regular

Joined: Sun Feb 12, 2006 10:18 pm
Posts: 60
Location: Rosario, Argentina
ooops! Sorry I posted such a dumb error, I've been working for a couple of months now with NH, but still I forgot to open and commit the transaction this tiome, and didn't even realized! and I did a lot of debugging! Stupid me...

Anyway, sergey, how come you didn't answer to these post of mine:

http://forum.hibernate.org/viewtopic.php?t=961197

and

http://forum.hibernate.org/viewtopic.php?t=961134

Thanks!


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 10, 2006 3:32 pm 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
I never promised I would answer all the posts here ;-)


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 10, 2006 3:48 pm 
Regular
Regular

Joined: Sun Feb 12, 2006 10:18 pm
Posts: 60
Location: Rosario, Argentina
True, but since noone else could (or wanted) to answer my questions, I thought you'd find it rather defying to see what the problem was and help a person in need to solve it... ;-)

Anyway, locking the Person in stead of the User seems to be working everytime, so I'm doing that now.

Thanks!

Alejandro.


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