[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-3983) @Observer methods may be called multiple times
Vanessa Williams (JIRA)
jira-events at lists.jboss.org
Mon Mar 2 16:50:22 EST 2009
@Observer methods may be called multiple times
Issue Type: Bug
Affects Versions: 2.1.1.GA
Reporter: Vanessa Williams
Some @Observer methods may be called multiple times, while others may not be called at all. This bug is reproducible; occurs in both 2.1.0 and 2.1.1 and requires specific circumstances (described below.)
I do not have the time (unfortunately) to create a sample project to demonstrate the problem, but it is easy enough to describe.
Create an EntityHome<E> subclass, let's call it FooHome.java. Override the persist() method and at the end of it, raise an event, say "fooSaved". Now, in the same class create a method postFooSaved() and annotate it with @Observer("fooSaved"). In any other component you like, create another @Observer method, with a different name, say watchFoo(), observing the same event. In this case, everything works as expected. After FooHome.persist() is called, postFooSaved() and watchFoo() will each be executed once.
Now to replicate the bug: create a subclass of FooHome.java, say BarHome.java. It doesn't matter what it contains. Now postFooSaved() will be executed twice and watchFoo() will not be executed at all.
As an extended demonstration, create an action component called FooAction.java and move the original postFooSaved() @Observer to that class. Again, all will work as expected, with postFooSaved() and watchFoo() each executing once. Now create a subclass of FooAction: BarAction.java. The bug will re-appear, with postFooSaved() executing twice and watchFoo() not executing at all.
Hope that helps.
This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the seam-issues