Looks like I ran into the same problem as you Ivan. I found a way to work around the problem by using a database to store a CDI message queue for each user. The CDI messages can be left by asynchronous threads, and then picked up within the user's session context. This glassfish ticket relates to the same problem: http://java.net/jira/browse/GLASSFISH-17152
But note that it's not a bug, it's just undefined behavior.
Hope that helps!
Thanks for your replay!
So if I've got it correctly, you use a database as a storage for results of asynchronously executed tasks. And then, each user's SessionScoped (or RequestScoped) bean can pick the result manually from the database. Yep... this is the first solution I've got in my mind. But instead of the database, I use ApplicationScoped bean (in my case it is quite satisfactorily).
Yep, either would work fine. ApplicationScoped bean would make it simpler actually. I have to make sure all messages and data trasfer objects are serializable. You wouldn't have to worry about that with an ApplicationScoped bean.