You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

If you want to learn NHibernate - read this blog: http://www.ayende.com/Blog/.

Today I tried to figure out why there are problems in serialization of DelftShell and it looks like most problems can be solved only by changing one line of code in XML mapping file. For example when project is created and any item is added to it, then save and then create a new folder and drag item to it - it will crash with some strange message telling something about cascades (hmm... I forgot what it really says). Looks like a problem was in:

cascade="all-delete-orphan"

if it is set to all relations like <any>, <many-to-one>, <one-to-many> - it will crash soon (smile). Solution is that for composition it must be all-delete-orphan and for a simple aggregation it must be "all".

It is explained here on Ayende's blog: NHibernate Cascades: the different between all, all-delete-orphans and save-update

  • No labels