开发者

EJB session bean Thread Safety

开发者 https://www.devze.com 2023-03-09 07:45 出处:网络
What is the exactly meaning of EJB session bean thread safety? what happens if I define static ArrayList i开发者_JAVA百科n the session beans (as you know ArrayList doesn\'t support multi thread)

What is the exactly meaning of EJB session bean thread safety?

what happens if I define static ArrayList i开发者_JAVA百科n the session beans (as you know ArrayList doesn't support multi thread)

OR

I mark my method with "synchronized" ?

RGDS


The EJB container ensures that session bean instances are thread-safe, so session bean methods do not need to be marked synchronized. A static ArrayList is never thread-safe (using EJBs or otherwise).

(The only exception to thread-safe session bean instances are EJB 3.1 singleton session beans using bean-managed concurrency.)

0

精彩评论

暂无评论...
验证码 换一张
取 消