Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6097311
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T13:01:43+00:00 2026-05-23T13:01:43+00:00

is following scenario possible? SessionService which is a stateless EJB fires an event LoggedInEvent.

  • 0

is following scenario possible?

“SessionService” which is a stateless EJB fires an event “LoggedInEvent”. A SessionScoped (Weld) bean “SessionBean” having a non static method observing the LoggedInEvent is called and initializes some things for that specific user.

Is the correct instance of “SessionBean” called? Are all instances called? I can not find anything in the documentation.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T13:01:44+00:00Added an answer on May 23, 2026 at 1:01 pm

    “The correct instance” is a slightly misleading wording.

    What happens is this:

    1. The SessionService is invoked (probably triggered by a web request).
    2. If it fires its LoggedInEvent, all registered observers are called in a synchronous way (meaning that SessionService will not terminate before all observers terminate).
    3. Each bean containing a (non-static) observer method will be instantiated (provided that the bean scope is active – which it usually is in a standard web environment(*)). This will be the case for your SessionBean. If – and only if – SessionBean has already been instantiated in your active session (there’s certainly only one session active regarding the web request), then this instance will of course be used.

    More details in the spec.

    So, to answer you question:

    Yes, the correct instance will be called. Why? Because it’s the responsibility of the container to make sure that only one SessionBean-instance is associated with the active session scope.

    (*): If an invocation is for example triggered by a remote ejb call, you can neither assume an active session nor an active conversation…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

is this possible somehow? Following scenario: statelesse local EJB with name A singleton startup
I have the following scenario in mySql, is it possible to update the values
Let's consider the following scenario: a function which can generate code colors from white
I'm not exactly sure if the following scenario is possible. Using only UdpClient or
I'm having the following scenario: class A { public static $arr=array(1,2); } class B
I wanted to ask if the following scenario is somehow possible to happen. I
Using C#/.NET 4.0 I was hoping the following scenario would be possible: interface IA<out
I have the following scenario: I have 5 possible values on a page: [value
I heard it's possible to use regular expression to replace. I have following scenario
I've been trying to find out if the following scenario is possible, I'll do

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.