EJB's and Threading

前端 未结 4 909
醉话见心
醉话见心 2021-02-06 08:55

From what I understand it is illegal to spawn threads from within an EJB as it may potentially interfere with the EJB\'s lifecycle. However, is it illegal to use predefined Java

4条回答
  •  粉色の甜心
    2021-02-06 09:10

    The biggest issue with threads and EJBs is that threads are a limited resource heavily used by the container, and thread mistakes lead to thread pool leaks that can effectively kill the whole JVM instance.

    Executor should be better behaved, but it's still going to use up a thread for some length of time; it also may just fail instantly if someone has tuned the container to use up the available threads.

    Summary is that you're going to be tightrope walking.

提交回复
热议问题