File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes running java app as a batch and deployment Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "running java app as a batch and deployment" Watch "running java app as a batch and deployment" New topic

running java app as a batch and deployment

Udayan Kumar
Ranch Hand

Joined: Jan 16, 2007
Posts: 66

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.

Let me know your thoughts.

Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 33117

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.

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
Udayan Kumar
Ranch Hand

Joined: Jan 16, 2007
Posts: 66
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.
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 13037
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.


Udayan Kumar
Ranch Hand

Joined: Jan 16, 2007
Posts: 66
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

Thanks Again
I agree. Here's the link:
subject: running java app as a batch and deployment
It's not a secret anymore!