Solved

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

Posted on 2002-03-26
4
287 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

The Orion Papers

Are you interested in becoming an AWS Certified Solutions Architect?

Discover a new interactive way of training for the exam.

Question has a verified solution.

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

By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…

728 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