However, after running into several unforeseen issues, I've been forced to revert all my code back to MyNHibernateContrib for my largest projects. The code may look a little uglier, but it works quite well. Here are the issues I've had in trying Ayende's library. He already knows about some of these and warns about them on this blog, but the extent to which they cause problems were greater than I anticipated based on his web page.
- As yet unpersisted entities added to a lazy and not yet loaded collection do not show up in the collection at all. And cascade save from the collection to the entity never happens! So my tens of thousands of lines of code written to take advantage of cascade save has bugs ridden through it suddenly, as entities are not saving all over the place.
- When I try to solve the the previous problem by disabling his extra lazy-loading feature for collections, I get lazy-loading exceptions thrown from NHibernate that I just haven't been able to solve.
- List collection persistence seems shaky (indexes within the list randomly changed).
- Map collection (Dictionary) persistence is non-existent.
- NHibernate collection cache doesn't match added contents, when an entity is added to an unloaded collection with something like apple.Tree = someTree; someTree.Apples, when loaded in some later ISession, does not include the apple, even when reloaded. The NH cache must be refreshed for it to ever show up.
No comments:
Post a Comment