GeeCON Prague 2014*
The moose likes Architect Certification (SCEA/OCMJEA) and the fly likes Thread problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Certification » Architect Certification (SCEA/OCMJEA)
Bookmark "Thread problem" Watch "Thread problem" New topic
Author

Thread problem

Duy Luong
Greenhorn

Joined: Jul 17, 2005
Posts: 6
hi masters

as restriction of ejb we not recommend to create thread in ejb bean. But is it ok when you create thread in DAO layer
Jeremy Hsu
Ranch Hand

Joined: Mar 28, 2005
Posts: 79
Well, this is a very tough question. Please post more about why you want to use thread in your DAO. The answer could be a yes or no.
[ August 29, 2005: Message edited by: Jeremy Hsu ]
Hitry Mitry
Ranch Hand

Joined: Jun 16, 2005
Posts: 32
I think it's little strange to create threads in the DAO layer - you already have multiple threads - one per user session- started by the servlet and propagated to the EJB layer. Why would you need more?
Jeremy Hsu
Ranch Hand

Joined: Mar 28, 2005
Posts: 79
I have seen scenarios where people need the result from tables from two remote databases. If you use threads to execute queries, the speed is much faster than making one queries and then after it is done and you make another.
[ August 30, 2005: Message edited by: Jeremy Hsu ]
 
 
subject: Thread problem