File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JBoss/WildFly and the fly likes Running batch job on jboss server Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "Running batch job on jboss server" Watch "Running batch job on jboss server" New topic
Author

Running batch job on jboss server

m sandeep
Greenhorn

Joined: Jan 24, 2011
Posts: 17
Sorry missed a few things

Hi Everyone,

I have a application that takes input file in xls which has large amount of data compare it with the db which would consits of update /insert and delete .Now which i integrated that with my web application it takes a long time to process so i am thinking to write a batch job for processing the files .Few things which i wanted to know

(i am talking about 10000 rows and 200 columns)


1. can a batch job file be executed in jboss server when it is already started since my application will also be deployed in the same server

2.will the batch job resolve the problem

3.alternate for doing it


Thanks

Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10354
    
    8

And you posted this in the portlets forum because....

This would be more suitable on the JBoss forum. I will move it there for you.
In future, please do take out time to CarefullyChooseOneForum

With the information you have shared, it could be a JBoss issue or a DB issue. Your best bet is to TellTheDetails


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5827
    
    7

I have seen others do something similar - using System.exec() to fire off the batch job to do things such as generated PDF files for reports. Note that this goes against the Java EE spec, mainly because the executed job is outside the control of the container (JBoss AS in this case), but if you are aware of the ramifications (no overall control of database transactions), then it is fine.

The other possibility if to implement the batch portion as a message-driven-bean. Then you app would send the request on a queue, the bean would get the request and then do the processing. This mechanism also affords the ability for your app to be notified when the batch process is done.


JBoss In Action
Koen Aerts
Ranch Hand

Joined: Feb 07, 2012
Posts: 344

I would do, and have done the same thing, as Peter suggests. Basically write a small class file that gets the file name(s) and send them to the JBoss server via messaging. Then implement an action class for that message to do the actual processing (open files, read, insert into DB, etc.).
William P O'Sullivan
Ranch Hand

Joined: Mar 28, 2012
Posts: 859

Why not look into using Quartz?

If you are using Spring, look at Spring-Batch framework also.

Pat.
William P O'Sullivan
Ranch Hand

Joined: Mar 28, 2012
Posts: 859

Sorry missed a few things

Hi Everyone,

I have a application that takes input file in xls which has large amount of data compare it with the db which would consits of update /insert and delete .Now which i integrated that with my web application it takes a long time to process so i am thinking to write a batch job for processing the files .Few things which i wanted to know

(i am talking about 10000 rows and 200 columns) <-- That is not too bad. (Depending on how processing is done per row)

1. can a batch job file be executed in jboss server when it is already started since my application will also be deployed in the same server

A. Yes: Your webapp would actually control the batch job execution, or deploy it separately.

2.will the batch job resolve the problem

A. Probably, processing 10,000 rows in a standard controller could potentially timeout, and be left dangling or rollback!
You need to process this volume asynchronously or in a batch mode.

3.alternate for doing it

A. Write your own TaskExecutor or thread to kick off the process. However, Quartz gives you more flexibility. DRY principle.
(Or in this case, Don't Repeat what someone else has done .. DRWSEHD ??)

Pat.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Running batch job on jboss server