Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2002-03-26
4
Medium Priority
?
289 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 90 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

Enroll in September's Course of the Month

This month’s featured course covers 16 hours of training in installation, management, and deployment of VMware vSphere virtualization environments. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
The viewer will learn how to implement Singleton Design Pattern in Java.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
Suggested Courses

670 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