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.)
精彩评论