Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds


  Asked By: Fabiana    Date: Apr 20    Category: Java    Views: 495

Can anybody help me with a simple Program to achive parallel
processing using java.

Depending on user input need to create multiple connections to DB and
all shuld fetch values from DB parallely..



2 Answers Found

Answer #1    Answered By: Feodora Bonkob     Answered On: Apr 20

there are loads of examples, just google it.

to answer the question Re: multithreading in java  I recommend you to read through "Allen Holub" website and his series of related articles in www.javaworld.com

this one is one of the 9th series of related articles - you can find the previous ones in the same site.
i.e http://www.javaworld.com/javaworld/jw-06-1999/jw-06-toolbox.html

it will give you running good examples

or in addition http://java.sys-con.com/read/83057.htm

but from the fact that this is a J2EE discussion group, I have a question for you,

are you trying to do this in the J2EE framework? If not just be careful with the overhead of single thread per user, you might be able to do this by a thread coordinator and thread pool to achieve better efficiency. don't create  a thread per request, this will cost you the performance of your system.

if you are deciding to do this in J2EE framework, you shouldn't worry about it, this is beyond your control, just implement an entery session per user  and let that one to interact with multiple  transaction to fulfil a single request - I leave the investigation on the proper pattern for yourself.

note: parallel reading from DB required extensive control for synchronization purpose, you might need to consider transaction attributes and lock/unlock on the data sources.

Answer #2    Answered By: Della Simpson     Answered On: Apr 20

The following URL is the chapter one of "Core JAVA" book about multithreading including java  1.5 new multithreading libraries. Some of issues like dispatching and having a thread pool is now included in Java 1.5. It is the best and the most comprehensive reading about Java multithreading that I've ever read.


Didn't find what you were looking for? Find more on MultiThread Or get search suggestion and latest updates.

Related Topics:



Related Post