• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Thread problem

 
Duy Luong
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic