Solved

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

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
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 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 …

930 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now