What is the exactly meaning of EJB session bean thread safety?
what happens if I define static ArrayList in the session beans (as you know ArrayList doesn’t support multi thread)
OR
I mark my method with “synchronized” ?
RGDS
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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.)