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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T19:43:42+00:00 2026-05-25T19:43:42+00:00

I need to wait for a condition in a Spring MVC request handler while

  • 0

I need to wait for a condition in a Spring MVC request handler while I call a third party service to update some entities for a user.

The wait averages about 2 seconds.

I’m calling Thread.sleep to allow the remote call to complete and for the entities to be updated in the database:

Thread.currentThread().sleep(2000);         

After this, I retrieve the updated models from the database and display the view.

However, what will be the effect on parallel requests that arrive for processing at this controller/request handler?

Will parallel requests also experience a wait?

Or will they be spawned off into separate threads and so not be affected by the delay experienced by the current request?

  • 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-25T19:43:43+00:00Added an answer on May 25, 2026 at 7:43 pm

    What are doing may work sometimes, but it is not a reliable solution.

    The Java Future interface, along with a configured ExecutorService allows you to begin some operation and have one or more threads wait until the result is ready (or optionally until a certain amount of time has passed).

    You can find documentation for it here:
    http://download.oracle.com/javase/6/docs/api/java/util/concurrent/Future.html

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

Sidebar

Related Questions

I need to wait for some events in my application, or wait for somew
I have few asynchronous tasks running and I need to wait until at least
I basically need to show a wait window to the user. For this i
For testing purposes I need my ABAP program to wait for few seconds. How
need ask you about some help. I have web app running in Net 2.0.
I need to wait in a script until a certain number of conditions become
i have a condtion if (!e.ComponentUp) ,if its true then i need to wait
I need to wait for an input for 20 seconds, after that myscript should
i have a input tag which is non editable, but some times i need
there is no need to wait for approval from Apple,in the case of hosting

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.