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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T22:02:51+00:00 2026-05-26T22:02:51+00:00

Im trying to implement a hot sparing method for availability, I have it in

  • 0

Im trying to implement a hot sparing method for availability, I have it in mind as follows:

  1. The client sends 3 identical requests, one for each server (we have 3, actually virtual machines)
  2. Each server receives the request and processes it
  3. When the server finishes, it pings the other servers if they have finished.
  4. If he is the first to finish, the he will reply and the others wont.

So I’m having trouble with making the 3 simultaneous requests. This is what I would normally do to call a Remote interface from a servlet

class Servlet_JSP_or_Something extends HttpServlet
{
     doGet(HttpReq...)
     {
          @EJB
          RemoteInterfaceEJB ejbclass;
          ejbclass.doSomething()
     }
}

But, now I guess I would have to do something like this

class Servlet_JSP_or_Something extends HttpServlet
{
     doGet(HttpReq...)
     {
          @EJB(name="Server1")
          RemoteInterfaceEJB ejbclass;
          ejbclass.doSomething()

          @EJB(name="server2")
          RemoteInterfaceEJB ejbclass;
          ejbclass.doSomething()

          @EJB(name="server3")
          RemoteInterfaceEJB ejbclass;
          ejbclass.doSomething()
     }
}

But I’m not so shure if that would work. I dont even know if @EJB(name=”…”) is enough
or how to set the name for each different ejb running on the different vitual machines.

So the question is:
¿How can I simultaneously call 3 identicall EJBs from the same servlet/jsp being that the EJBs are running on different machines?

  • 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-26T22:02:53+00:00Added an answer on May 26, 2026 at 10:02 pm

    Stick the request on a queue, have the 3 machines listen on the queue, and wait for the result. If any of them fail during the processing, the request will go back on the queue and be handled by one of the other two. Having 3 systems running simultaneously on the same request, and “racing” to succeed sounds just wildly fraught with danger and craziness.

    I mean, it makes sense for avionics with voting systems to help ensure jetliners don’t spontaneously plunge in to the sea, but most systems don’t really have that burden of reliability. They also tend to have really big engineering budgets.

    So, I would go with the JMS queue.

    Addenda:

    The queue is managed by a cluster, then the EJBs can be deployed in their own cluster (or simply independent workers, they don’t even have to be EJBs, they can be anything). The EJBs are all subscribed to the same queue. Each bean takes a message off the queue and runs with it. The taking of the message is transactional. If the EJB fails for whatever reason, the message becomes available on queue again, ready for another EJB to take it.

    Both the JMS queue and the EJB servers are redundant so that neither are a single point of failure.

    Many of the EJB servers today can be clustered, so it’s just a matter of configuring your server in to a cluster, and calling it. Your client code wouldn’t change.

    If you’re not happy with this arrangement, then you can instead of using remote EJB calls, you can switch to Web Services, and front the service handler servers (i.e. the EJB servers) with a (clustered) load balancer to distribute traffic.

    None of this addresses all of the issues that occur when taking a single stack process redundant in terms of state sharing, race conditions, session affinity, etc. etc.

    There is no “simple” annotation to do this. Using out of the box clustering specific to your container is probably as close as you’re going to get.

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

Sidebar

Related Questions

Trying to implement what I thought was a simple concept. I have a user
Trying to implement a MSMQ-backed WCF PubSub. I understand that net.msmq is one-way; however
Im trying to implement pagination using multiple searching criteria. Supposed I Have student table.
Trying to implement the following behavior on an iPad. I have a map-centric application
Trying to implement a timer for my game that I'm making. I have a
Trying to implement a simple print in SL4. I have a DataGrid that I
Im trying to implement an Observer/Observable pattern on an EC2 instance. I have been
All I am currently trying implement something along the lines of dim l_stuff as
trying to implement a dialog-box style behaviour using a separate div section with all
Trying to implement a rating system of users and postings. What is the best

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.