Solved

Is Java-based web application suitable for batch processing...

Posted on 2002-03-26
4
288 Views
Last Modified: 2010-03-31
I hv a Java web-based application (JSP -> Servlet -> Java Classes) running on Linux Websphere Server..i try to run some batch process that involve a lot of updating/inserting operation to database..i invoke the process from the JSP page with a button click..and the process will start..the database(Informix) is quite huge..after finish the process..it suppose to come back to JSP..displaying some successful messages

the problem is that it the browser always timeout..can't even wait for the server to finish process all the data..so it look like web-based aaplication is not suitable for batch processing because the browser will always time out if keep waiting for a long time...


can u give any suggestion to improve it..

0
Comment
Question by:kgsoft_sys
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 

Accepted Solution

by:
abhay_djs earned 30 total points
ID: 6898338
Hi kgsoft_sys,
In websphere, there is one property which checks out inactivity timeout for respons. I am not much aware of what is the exact name of this property. I will search for same and let you know.
But if u increase that timout, then the your problem is solved. But yes thats not the best way to solve your problem.
What you can do is to create multiple threads. and perform insert update in that threads. So that the operation can be performed faster.

THanks
Abhay
0
 

Author Comment

by:kgsoft_sys
ID: 6898467
can you show me a simple example how to create a thread that can do insert/update to database..?
0
 
LVL 2

Expert Comment

by:deviprasadmp
ID: 6898523
You can have a separate table in the database to indicate the status of ur batch process.  For simplicity you can have a table with a few columns, say, STARTDATE, STARTTIME, JOBEXITCODE, MESSAGE.  Once u click the button on ur JSP, you can update JOBEXITCODE to 1 and MESSAGE to "Running...", then start a thread which actually does the job, then show a JSP page saying "The job has started..."  Now this JSP should query the table and refresh itself (You can use the HTML <META> tag for this) with the text in the MESSAGE column. And the rest is your imagination...
0
 

Expert Comment

by:abhay_djs
ID: 6902085
The code will be very complicated.
I am giving you rough logic.
In JSP you have to create one bean wich looks after the threads you r going to create for insertion. And execute method of that bean say 'process'
Now in 'process', you have to create various threads depending on the table and values to be inserted.
Of course you can write generic thread class say MyThread which accepts 'tablename' and vector of vectors having values to be inserted in that table. And in the RUN method u can insert all those values.
But u have to be careful in 'process' that till all the threads get executed you should not leve the control from that method.

THats the general way.
I hope i have made it clear.

Thanks
Abhay
0

Featured Post

What is a Denial of Service (DoS)?

A DoS is a malicious attempt to prevent the normal operation of a computer system. You may frequently see the terms 'DDoS' (Distributed Denial of Service) and 'DoS' used interchangeably, but there are some subtle differences.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Suggested Courses

615 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question