0
votes

I am using a @SessionScoped CDI bean that adds a new record in the database and fires a CDI event to notify observers.

In the JSF I am using a4j:push to render a component when the event fires, and it works as expected.

In the same session bean that fires the event, I also have an observer method to print a message and this only works for the session (browser) that fired the event.

All other browsers receive the event in the JSF (the content is rendered and I see the new record) but the method in the backing bean is not invoked.

From other posts about this issue I know that extending CDI Observer pattern to support global events would work (http://blog.akquinet.de/2012/02/28/extending-cdi-observer-pattern-to-support-global-events/).

But why it works like expected on the JSF side and not on the backing bean method side without any modifications ?

1

1 Answers

0
votes

That would be because they're bound to that same session, other sessions shouldn't be receiving events for different sessions.