0

Hy, I am writing a GWT app. App consists of getting, storing and showing some informations. On a client side I show information that I get from database using RPC calls. Next, I have to fetch XML file from remote server, pars it and store data in database every 10 seconds. I have to do that on server side without interacting with client side so that would be running even if no one is browsing the app. Does anyone have a solution for this?

I tried to solve this with calling the method, that is fetching, parsing and storing data, from client side every 10s with timer but that doesn't work because this will work only if someone is looking at the app in the browser at the moment, but if no one is browsing it for a month, data from remote server won't be fetched and stored for a month and that is a problem.....

I really need solution...Thanks in advance!

1 Answers1

0

If you use a full Java EE Application Server, you can use the Timer facilities from Java EE (see the Oracle Tutorial).
Otherwise you could look if your server has some proprietary solutions for this. A third solution would be writing a separate batch application and trigger that via cron job or running it as a daemon.

dunni
  • 38,210
  • 8
  • 94
  • 96
  • Sorry for maybe stupid comments and questions, I am new in this. The app is running on local server (Glassfish). I already have this method on GWT server side. Is there any way to trigger it every 10s from inside app, or to start running it in separate thread without triggering it from outside. – user1527100 Sep 02 '12 at 10:28