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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T17:08:24+00:00 2026-06-04T17:08:24+00:00

I have a servlet which does the following: Gets a set of data from

  • 0

I have a servlet which does the following:

  1. Gets a set of data from a webservice
  2. Gets a set of data from the local database.
  3. Merges the two sets and returns the results.

Actually little of this is done within the servlet code itself, but the servlet calls Java classes which do the above.

Since most of the time is spent waiting for both the webservice and database, I am considering performing the two concurrently: put the webserivce call in a thread, get the data from the Database, and then waiting until the webservice is done before continuing. This seems like it should work fine, but I often hear that launching threads from servlets is a bad idea? I am having trouble seeing how this situation would lead to problems. Any help would be great (using tomcat 6 on linux). Thanks!

  • 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-06-04T17:08:26+00:00Added an answer on June 4, 2026 at 5:08 pm

    I dont see anything wrong with it and have often seen threads being started from a servlet itself. You use-case is good justification for starting threads within servlet.

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

Sidebar

Related Questions

In an embedded Jetty container I have a servlet which pushes data to the
I have a Java servlet from which I need to send few notifications to
I have the following problem: I created the servlet which should draw a dynamic
I have a java servlet that sets a request attribute which is served for
I have a servlet which does some error checking and if something is wrong
I have the following problem. I programmed a java servlet, which responses to ajax
We have a GWT application which draws some resources from a separate servlet via
I have a servlet which can accept upwards of two dozen different kinds of
I have a web application in Java which does data exchange using XML. I
I have servlet which does a forward using requestdispatcher() to one of my jsp

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.