• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Doubt abt threads in EJB

 
Chaminda Amarasinghe
Ranch Hand
Posts: 413
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

In fact, It is not allowed manage (create) threads inside Enterprise Bean. Can you please confirm me, that restriction still remains to helper classes used by bean?

Also I want to know is this restriction only to threads or including all Runnables ?

Thanks
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Core Specification 21.1.2 Programming Restrictions
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.

These functions are reserved for the EJB container. Allowing the enterprise bean to manage threads would decrease the container�s ability to properly manage the runtime environment.


This also applies to utility classes used by beans. Runnable is intended to be used in threads, isn't it ? So when they say "threads", this implies Runnable objects executed by threads.
 
Chaminda Amarasinghe
Ranch Hand
Posts: 413
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Christophe,

Grate explanation. Cleared the doubt.

Best Regards
-Cham
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic