开发者

EJB session bean Thread Safety

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜