I loop thru the collection if and only if this condition is satisfied:

IEnumerable eventCollection = @event.Collection as IEnumerable;
if(eventCollection != null && @event.Collection.WasInitialized)
...audit
else
...skip

On Mar 24, 5:41 pm, Fabio Maulo <[email protected]> wrote:
> Probably is Not a bug.
> Are you loading a collection inside your listeners ?
>
> 2010/3/24 Michael diSibio <[email protected]>
>
>
>
>
>
> > Wondering if this is officially a bug and will it get fixed?
>
> > We have no listener on Flush events, only on the PostInsert/Update/
> > Delete and PostCollectionRecreate/Update/Remove.
>
> > We have implemented a Unit of Work pattern, in which we set FlushMode
> > to Never and explicitly call Flush();
> > Our listeners spawn an Audit transaction that occurs within a
> > StatelessSession.
>
> > When Flush() completes, the log shows this AssertionFailure thrown
> > from the AbstractFlushingEventListener.PostFlush() call on a
> > collection belonging to an entity that was updated.
>
> > On Feb 17, 7:05 am, "[email protected]"
> > <[email protected]> wrote:
> > > Easy fix.  When configuring your session factory, replace the default
> > > & auto flush event listeners with the classes below.
>
> > >     [Serializable]
> > >     public class FlushFixEventListener : DefaultFlushEventListener {
>
> > >         public override void OnFlush(FlushEvent @event) {
> > >             try {
> > >                 base.OnFlush(@event);
> > >             }
> > >             catch (AssertionFailure) {
> > >                 // throw away
> > >             }
> > >         }
> > >     }
>
> > >     public class AutoFlushFixEventListener :
> > > DefaultAutoFlushEventListener {
> > >         public override void OnAutoFlush(AutoFlushEvent @event) {
> > >             try {
> > >                 base.OnAutoFlush(@event);
> > >             }
> > >             catch (AssertionFailure) {
> > >             }
> > >         }
> > >     }
>
> > > On Feb 16, 5:49 pm, kimsk112 <[email protected]> wrote:
>
> > > > I got the same problem too. I have to remove the
> > > > PreUpdateEventListener for now.
> > > > --karlkim
>
> > > > On Jan 8, 11:29 am, epitka <[email protected]> wrote:
>
> > > > > No, I just gave up and added a mapped field so I don't have to load
> > > > > anything in PreUpdate.
>
> > > > > On Dec 15 2009, 1:07 am, acl123 <[email protected]> wrote:
>
> > > > > > Exactly the same problem here :)
>
> > > > > > On Dec 3, 8:05 pm, Revin <[email protected]> wrote:
>
> > > > > > > Hiepitka,
>
> > > > > > > Do you have any luck with this problem?
> > > > > > > I got the same error message...
>
> > > > > > > Thanks...- Hide quoted text -
>
> > > - Show quoted text -
>
> > --
> > 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]<nhusers%[email protected]­>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/nhusers?hl=en.
>
> --
> Fabio Maulo- Hide quoted text -
>
> - Show quoted text -

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