-->
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.  [ 7 posts ] 
Author Message
 Post subject: Updating Graph Like Structures
PostPosted: Thu Jul 28, 2005 4:23 pm 
Beginner
Beginner

Joined: Tue May 17, 2005 11:42 am
Posts: 22
Maybe someone can help me with this problem.
I am working with a tree structures, i am able to persist the tree ok.
The whole tree persists as it should, and loads correctly back from the database. The problem arises when i decide to detach one of the leaves, and reassign it to another leaf, attaching and detaching of the leaves happen at the same level. (This happens after loading from the db)

Image

The ISet structures, will update, everything it's ok.
Then I execute a Session.SaveUpdate(tree);
And i get...:
Quote:
"Flush during cascade is dangerous - this might occur if an object as deleted and then re-saved by cascade"


My guess is that nhibernate is issuing a delete instead of an update to the node i'm removing and will then reattach back to the tree.
(Might this be true?)
It's is possible that what's needed may be a second pass?
Also, when retrieving from the database if add a new instance to the tree... I get:
Quote:
"object references an unsaved transient instance - save the transient instance before flushing: "


Have in mind this works when i was working with a fresh instance, I can persist it and continue working with it and then persist it again, also attaching and detaching works.

I'm new to nhibernate, and I don't know if this is suppose to be a bug or feature, or what :S.
I can tell the mappings seem to be working ok, because i can save and load correctly, but something is wrong with the retrieved objects, because they are not following the same behaviour as the recently created and persisted new ones. If anyone might shed some light on this issue it will be greatly appreciated.
Thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 29, 2005 5:51 pm 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
Do you have a parent attribute for each leaf, and inverse="true" applied to the children collection? I believe it should solve your problem.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 01, 2005 2:21 pm 
Beginner
Beginner

Joined: Tue May 17, 2005 11:42 am
Posts: 22
I have it the mappings defined that way. Any ideas on which is the problem?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 16, 2005 3:52 pm 
Newbie

Joined: Thu May 26, 2005 1:51 pm
Posts: 4
I'm having same problem. Any idea?


Top
 Profile  
 
 Post subject: Same here
PostPosted: Sat Oct 01, 2005 12:20 pm 
gsalatino wrote:
I'm having same problem. Any idea?


I just saw this pop up as well on my site with v1.rc2 - any ideas?


Top
  
 
 Post subject:
PostPosted: Sat Oct 01, 2005 1:32 pm 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
http://www.hibernate.org/117.html#A25


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 05, 2005 3:13 pm 
Beginner
Beginner

Joined: Tue May 17, 2005 11:42 am
Posts: 22
This is the problem actually...
http://opensource2.atlassian.com/projec ... se/HHH-785


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