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 672673
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T00:30:37+00:00 2026-05-14T00:30:37+00:00

I am wondering conceptually how load-balancing works on the EJB-level (not web session replication)

  • 0

I am wondering conceptually how load-balancing works on the EJB-level (not web session replication) with Java EE containers like Glassfish. From what I have gleaned your remote interface is a proxy that delegates your call to one of many servers you may have in an environment.

If things fail are they supposed to be able to “finish” on another server? I want to understand the basic theory behind this load balancing, why is it better than a bunch of servers all running a plain web application with session affinity on a load-balancer?

  • 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-14T00:30:37+00:00Added an answer on May 14, 2026 at 12:30 am

    I am wondering conceptually how
    load-balancing works on the EJB-level
    (not web session replication) with
    Java EE containers like Glassfish.
    From what I have gleaned your remote
    interface is a proxy that delegates
    your call to one of many servers you
    may have in an environment.

    You are right. In Glassfish, the initial lookup will try to contact one of the server listed in the jndi.properties file. The server then know all the other node in the cluster that will be used for round robin. The remote reference (proxy) will do that for you transparently. Theoretically nodes can be added/removed from the cluster dynamically. See Glassfish RMI-IIOP load balancing and fail-over.

    If things fail are they supposed to be
    able to “finish” on another server? I
    want to understand the basic theory
    behind this load balancing, why is it
    better than a bunch of servers all
    running a plain web application with
    session affinity on a load-balancer?

    If the bean is stateless, you don’t even need any kind of affinity and the request can be processed on any node. Each remote reference act as a load balancer on its own.

    If the bean is statefull, it’s more hairy. The cluster will try to maintain 2 replica of the bean. And the request are dispatched against these two replica. If one of the node crashes, the cluster will recreate another replica until the node is back — It’s indeed similar to HTTP session replication with session affinity.

    But on the contrary to a web server, bean are transactional components. So if an exception occurs, the transaction is rolled back and the stateful bean is invalidated because its state may not be consistent any longer.

    As pointed out by Pascal, there is some kind of fail-over for certain kind of failure. I the node is not available, the request can re-routed to another node. But if the node fails while the request is processed, I don’t know whether it can resubmit it somewhere else.

    If you want to know more, I suggest you read Guide to GlassFish High Availability and Cluster Support in Glassfish.

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

Sidebar

Related Questions

Wondering if there's any not-too-hard way to edit non-form text in html 4. I
Wondering if anyone knows a nice way to execute a Java command-line program from
wondering how I can replace all special chars on my string like: hello this
Wondering whether there is an efficient way to add an item to Java's ArrayList
Wondering how does an application like Process Explorer or Combo Fix detect hidden process
Wondering how to substring the last two characters quickly in Java?
Wondering what will be the default classpath when not specifying classpath option?
I have a scrollable area that contains popup menus. Conceptually, something like this: <div
Wondering if anyone has gotten the infamous database is locked error from Trac and
Wondering if there is any Text to Speech software available as a plug in

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.