• Post Reply Bookmark Topic Watch Topic
  • New Topic

EJB 2.1 / Thread.sleep()

 
Ådne Brunborg
Ranch Hand
Posts: 208
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Concider the following code, from inside a file called from a SessionEJB:



Is this a violation of the spec? The spec states

The enterprise bean must not attempt to manage threads. The enterprise bean must not attempt to start, stop, suspend, or resume a thread, or to change a thread�s priority or name. The enterprise bean must not attempt to manage thread groups.
 
Jorge Ribeiro
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It seems to me that this violates the spec. I would recommend to replace the use of the sleep with the new Timer Service- create a timer that will be triggered in X seconds (where X is your sleep time) and the timer will invoker your method
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!