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)
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.