http://nhforge.org/blogs/nhibernate/archive/2008/10/04/the-best-way-to-solve-nhibernate-bugs-submit-good-unit-test.aspx

On Wed, Oct 22, 2008 at 9:10 PM, Jan Limpens <[EMAIL PROTECTED]> wrote:

>
> Hm, _no_ idea what I should test here, business wise it is tested and ok.
> If my code is as it should be, this would be way in the innards of nh.
> No idea what I should test there. While I completely understand you
> point, "create a test" is easier said than done...
>
> On Wed, Oct 22, 2008 at 5:01 PM, Ayende Rahien <[EMAIL PROTECTED]> wrote:
> > Please create a test case that demonstrate the problem
> >
> > On Wed, Oct 22, 2008 at 8:59 PM, Jan Limpens <[EMAIL PROTECTED]>
> wrote:
> >>
> >> Hi guys,
> >>
> >> I have a
> >>                <subclass name="Product"
> >>                        <set name="SubArticles"
> >>                                         table="Articles"
> >>                                         access="field.camelcase"
> >>                                         cascade="all-delete-orphan"
> >>                                         inverse="true">
> >>                                <key
> column="[SubArticleParentArticleID]"/>
> >>                                <one-to-many class="SubArticle" />
> >>                        </set>
> >>                </subclass>
> >>
> >> do this:
> >>
> >>                public void AddSubArticle(int id, string name, string
> >> description,
> >> decimal price, int weight)
> >>                {
> >>                        var parent = prodDao.GetById(id);
> >>                        parent.AddSubArticle(name, description, price,
> >> weight); //
> >> subarticle knows about it's parent here
> >>                        prodDao.SaveOrUpdate(parent);
> >>                        prodDao.CommitChanges();
> >>                }
> >>
> >> and get a
> >>
> >> null id in SubArticle entry (don't flush the Session after an exception
> >> occurs)
> >>
> >> This is quite by the book. What could I be making wrong?
> >>
> >> the log reads:
> >>
> >> 2008-10-22 16:50:16,086 [4] INFO  NHibernate.Engine.Cascade -
> >> processing cascade
> >> NHibernate.Engine.CascadingAction+SaveUpdateCascadingAction for:
> >> Product
> >> 2008-10-22 16:50:16,086 [4] INFO  NHibernate.Engine.Cascade - cascade
> >> NHibernate.Engine.CascadingAction+SaveUpdateCascadingAction for
> >> collection: Product.SubArticles
> >> 2008-10-22 16:50:16,086 [4] INFO  NHibernate.Engine.Cascade - done
> >> cascade NHibernate.Engine.CascadingAction+SaveUpdateCascadingAction
> >> for collection: Product.SubArticles
> >> 2008-10-22 16:50:16,086 [4] INFO  NHibernate.Engine.Cascade - deleting
> >> orphans for collection: Product.SubArticles
> >> 2008-10-22 16:50:16,086 [4] INFO  NHibernate.Engine.Cascade - done
> >> deleting orphans for collection: Product.SubArticles
> >> 2008-10-22 16:50:16,086 [4] INFO  NHibernate.Engine.Cascade - done
> >> processing cascade
> >> NHibernate.Engine.CascadingAction+SaveUpdateCascadingAction for:
> >> Product
> >> 2008-10-22 16:50:16,086 [4] ERROR NHibernate.AssertionFailure - An
> >> AssertionFailure occured - this may indicate a bug in NHibernate
> >> NHibernate.AssertionFailure: null id in SubArticle entry (don't flush
> >> the Session after an exception occurs)
> >>
> >>
> >> --
> >> Jan
> >> ___________________
> >> [EMAIL PROTECTED]
> >> www.limpens.com
> >> +55 (11) 3082-1087
> >> +55 (11) 3097-8339
> >>
> >>
> >
> >
> > >
> >
>
>
>
> --
> Jan
> ___________________
> [EMAIL PROTECTED]
> www.limpens.com
> +55 (11) 3082-1087
> +55 (11) 3097-8339
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to