-->
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: Problem with "Cascade "
PostPosted: Wed Mar 15, 2006 9:12 pm 
Newbie

Joined: Wed Mar 15, 2006 4:59 am
Posts: 3
I have gone across the problem,and I really don't know what goes wrong:
this.m_Parent = this.m_Session.Load(typeof(Parent), 1) as Parent;
this.m_Child.SingleParent = this.m_Parent;
his.m_Child.ChildID = 1;
this.m_Child.Name = "Child01";
this.m_Parent.Children.Add(this.m_Child);
this.m_Session.Flush();
I have set the parent objects to cascade "All",and inverse"true" .But when I flush the session.An exception breaks out:
NHibernate.HibernateException was unhandled
Message="SQL insert, update or delete failed (expected affected
row count: 1, actual affected row count: 0). Possible causes: the row was modified or deleted by another user, or a trigger is reporting misleading row count."
Source="NHibernate"

While I having none trigger for the database


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 16, 2006 1:00 pm 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
Check that correct unsaved-value is specified in your mapping files. If in doubt, post them here.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 17, 2006 2:29 am 
Newbie

Joined: Wed Mar 15, 2006 4:59 am
Posts: 3
Hum,thanks sergey.
I did try that and got the reason.It's my fault missing the unsaved-value
attribute in my mapping file.


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.