Running a job through a Servlet



Hi all,

I would like to kick of a very long running process. All classes used
by this job are instatiated through a spring context. Our entire
application framework (on my development teams side) is a set of
webservices accessed by a client developed by another team. Therefore
basically everything we do is a session. There is a very long process
we have that we run locally that brings data in from one database,
manipulates that data, and then places the data into a different
database. This entire process is slow since we are in Chicago and
both databases are in New York. What I would like to do is deploy a
solution in our application server in New York that can run this job
on demand. Beyond the data we take from the database we also supply
this job with a couple simple arguments (basically two strings). I
have been tinkering around with JMX, however this just doesn't seem to
be panning the way I'd like. What I would like to do is create a
simple servlet that we can feed our input of a couple string and have
it run the job. I am in no way an expert with servelts and just have
a couple questions before I invest time going this route (if it is
indeed a viable route). My concern is how can I kick a task off from
a servlet and let it continue to run when I end a browser session. As
I said I am certainly no expert in when it comes to servlets so I am
just curious if I could say spawn a thread to run said task and have
this task continue to run outside of the servlets session (or context
even). This could be a very simple thing, but just wanted to see if
there was a good way of doing this. If there is anything you would
like me to clear up or if I am way of base with this path please let
me know. I appreciate any suggestions and criticism.

Thank You,
Kevin

.



Relevant Pages

  • Re: A2LL ist tot...
    ... | mit Tomcat als Servlet Container. ... | # Bugs - You think you have a bug or there is a difference in behavior with another servlet container. ... | # Database - Getting tomcat to talk to a database. ...
    (de.talk.tagesgeschehen)
  • Re: Is it bad to connect to a database via an applet?
    ... I want to write a game in an applet that ... utilizes a database. ... Do I have a middle page, a servlet, that sits on the server ... The simplest safe way to get the data from the db on the server to your applet on the client is to build a servlet as your middleware. ...
    (comp.lang.java.programmer)
  • Re: Creating new thread from servlet
    ... I have a Java servlet running in Tomcat that is a form. ... into a database. ... time to execute, thus the submission of the form takes a long time. ... Start the threaded task and cache the thread-id or the runnable object or thread complete flag with some unique key ...
    (comp.lang.java.help)
  • Re: java.lang.OutOfMemory Error
    ... > In a servlet, I am reading from the database and writing to PrintWriter ... The database returns around 50,000 rows. ... > as there are no object creations inside the loop and I am re-using the ...
    (comp.lang.java.programmer)
  • Re: Design issue: Viewing files in Web application and hide it from user based on security
    ... Ashraf Fouad wrote: ... database could be a better choice. ... use the same technique to protect the files as you would use ... That servlet should perform security checks etc. ...
    (comp.lang.java.programmer)