File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Running batch job on jboss server

 
m sandeep
Greenhorn
Posts: 17
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 10971
11
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Koen Aerts
Ranch Hand
Posts: 344
Java Linux Oracle
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 859
Chrome IBM DB2 Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why not look into using Quartz?

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

Pat.
 
William P O'Sullivan
Ranch Hand
Posts: 859
Chrome IBM DB2 Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic