I have a scenario where in we have to run a java application as a batch operation. i.e. the java application will be executed a 100k or more times once a month.
The app in question is a core java application which makes use of few Apache utilities and Hibernate to communicate to the database.
I want to understand if it is ok to deploy such an application (batch intensive) on an application server. The plan is to provide a basic harness UI page to trigger the java batch operation. Is this inadvisable approach considering the impact on the performance of the app server as the batch operation would take quite a while?
The other option is to run the application as a standalone where in someone would have to trigger the application at periodic intervals. I looked at batch task utilities like Quartz but they don't run a job in auto schedule manner rather have to be chained with some batch initiating utility.
Another approach was to use Batch management system tools like Autosys or Ctrl-M but currently this option looks like a heavyweight solution for the problem scenario we are facing.
Application servers are designed to run multiple things at once. Having a batch job doesn't tie it up assuming you have enough memory/CPU allocated. Of course, you have to do this for a standalone program too or the machine will be too overloaded for the app server to run properly anyway.
May seem to be a dumb question but is there an option where a call can be initiated from the app server and the memory intensive task of running the actual java (long running batch) application can be offloaded to use another JVM on the same machine w/out interfering with the app server's resources.
Sure, just execute a .bat file - that will run in a new instance of jvm and insulate your app server from disasters.
If there are other machines on the network, you could start the job there. With something like JavaSpaces you could have a number of these batch jobs running all over the network, thus spreading the load away from your server.
Joined: Jan 16, 2007
Sorry for the late reply.
Rather than executing an external batch file I want to offload the current task to a new instance of JVM as mentioned in your post to insulate the app server from disasters.
From the servlet I call a method in a class and want this entire process to be shifted to a new instance of JVM.
We have our workflows clearly defined when we want this sort of behavior in the web app.
I tried searching on this but did not get much info so If someone has implemented anything similar do share your thoughts
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
subject: running java app as a batch and deployment