Programming in C#: NHibernate 3.3 mapping issue on newest questions tagged c# – Stack Overflow

After migration my ASP .NET MVC project from NHibernate 3.0 to NHibernate 3.3 I get one problem.

After updating project references, all my application works fine, but on inserting Conference entity, I get exception on NHSession.Flush:

Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index

On modifying entity all works fine.
I found that problem is in that mapping code:

<set name="IssuedTickets" lazy="false" cascade="all-delete-orphan"
    table="conference_tickets" optimistic-lock="false" fetch="select" batch-size="250">
    <key column="conference" not-null="true" />
    <one-to-many class="ConferenceTicket" not-found="exception"/>
</set>

Class code:

[CustomValidationMethod("ValidateParticipants", ErrorMessage = "XXX")]
public virtual Iesi.Collections.Generic.ISet<ConferenceTicket> IssuedTickets { get; protected set; }

What difference has the Hibernate 3.3 as compared to NHibernate 3.0 in the mapping.
And how to solve my problem?

See Answers


source: http://stackoverflow.com/questions/10814215/nhibernate-3-3-mapping-issue
Programming in C#: programming-in-c



online applications demo