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

  • Home
  • SEARCH
  • 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 6375865
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T01:40:14+00:00 2026-05-25T01:40:14+00:00

I know Stateless EJBs are stored in a pool and instantiated as needed, my

  • 0

I know Stateless EJBs are stored in a pool and instantiated as needed, my question is, what happens when there are more EJB dependencies, for example with something like this:

@Remote
@Stateless
public class Master_EJB{
     @EJB
     private EJB_A ejb_A;

     @EJB
     private EJB_B ejb_B;
}

With EJB_A and EJB_B also being stateless EJBs.

In the worst case, if there are two petitions at exactly the same time, the server will retrieve two instances of Master_EJB from the pool (or create if needed).

But if from those two calls, one only needs the EJB_A and the other only the EJB_B, how many instances are needed: 4 (2 Master_EJB + 1 EJB_A + 1 EJB_B) or 6 (2 Master_EJB + 2 EJB_A + 2 EJB_B)?

  • 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-25T01:40:15+00:00Added an answer on May 25, 2026 at 1:40 am

    EJB_A and EJB_B are stateless or stateful?

    If stateless, answer depends on container/pool type used and recent situation (number of requests, server load and so on).
    If stateful and container will instantiate 2 Master_EJB instances, then two instances of EJB_A will be instantiated and also two instances of EJB_B will be instantiated.

    Please bear in mind that container may create two Master_EJB instances – it depends on container itself and the current situation again (as well, container may decide to process request using only one Master_EJB instance).

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

Sidebar

Related Questions

I know that there are many different architectures exist. In this question I consider
I have a @Stateless EJB using container managed transaction. Is there a way to
this is a conceptual question. As far as I know, MVC has a stateless
I know that I can do something like $int = (int)99; //(int) has a
Its a well know fact that webservices are stateless. Its written in every text
Does anybody know whether I can use multiple data sources in a single stateless
This is a pretty newbie question- please know I'm aware of that. I have
I do not know whether it is possible but i want something like <f:view>
I have a stateless EJB and two different SessionScoped managed beans. e.g. EJB as
I'm not exactly sure what question to ask here since I don't know the

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.