Win a copy of Modern JavaScript for the Impatient this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Caching Data After StartUp

Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've got a servlet to cache my data from several databases located all over the world. Some have fast lines, some slow. I initially had all of the data cached on start-up by setting the servlet to run in web.xml, but now some of the offices that have been added are taking 10 minutes plus to connect to.
My question is, how do I automate the caching of my data after the appilcation itself has started, so that the application doesn't take forvever to come online, but that the data can be populated as the databases return their queries?
I'd really appreciate any example code.
Many thanks
Ranch Hand
Posts: 309
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i guess, you can start a background thread in your init() method of the servlet. this will not stop your appl. from coming online.
Author and all-around good cowpoke
Posts: 13078
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1. Didn't you already post this question and get reasonable answers in some other forum? I seem to recall exactly this question.
2. Your name is not compatible with JavaRanch conventions - didn't you read the instructions when you signed up?
    Bookmark Topic Watch Topic
  • New Topic