Why is thread creation and management disallowed in EJB?

Answered

Why is thread creation and management disallowed in EJB?

Ninja Asked on 18th September 2018 in EJB 3.x.
Add Comment
1 Answer(s)
Best answer

The EJB specification assigns to the EJB container the responsibility for managing threads. Allowing enterprise bean instances to create and manage threads would interfere with the container’s ability to control its components’ lifecycle.

Thread management is not a business function, it is an implementation detail, and is typically complicated and platform-specific. Letting the container manage threads relieves the enterprise bean developer of dealing with threading issues.

Containers deny enterprise beans the privilege to manage threads for three basic reasons: Resource management, security, and thread-sensitive storage.

Ninja Answered on 18th September 2018.
Add Comment