Hi there,
The issue AR-ISSUE-261 was just created by Matt (MattF).
Key: AR-ISSUE-261
Summary: certain events get registered twice (IPostInsertEventListener,
IPostUpdateEventListener & IPostDeleteEventListener)
Type: Bug
Importance: High
Description:
when using the [EventListener] attribute (and by other means as well)
any events which inherit from IPostInsertEventListener,
IPostUpdateEventListener or IPostDeleteEventListener get registered twice (and
therefore the event gets fired twice for that class)
i have narrowed down the issue to the Contribute method of the
EventListenerContributer class. It iterates over the 'eventTypes' variable to
determine the different types of event listeners (so it can add them to the
appropriate properties). however 'eventTypes' (which is generated by
NHEventListeners.GetEventListenerTypes() ) contains duplicates because there
are some events that share the same interface type e.g. PostUpdate and
PostCommitUpdate. This causes the same eventListeners to be registered twice
because the same event type is looked at twice by the foreach loop.
i am not really sure how you are going to fix this, because it means that the
interface that a listener derives from is not enough to determine the event
type (because it is a one-to-many relationship). i guess you should identify it
by using a NHibernate.Events.ListenerType property in the attribute instead.
p.s. this is causing me grief because it means my event is firing twice for
each update, which means my audit logging has duplicates
For more, see
http://support.castleproject.org/projects/AR/issues/view/AR-ISSUE-261
--
donjon
by Castle Stronghold
http://www.castle-donjon.com
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Castle Project Development List" 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/castle-project-devel?hl=en
-~----------~----~----~----~------~----~------~--~---