I am building an application with Struts2, Spring, Hibernate.
Struts actions are managed by Spring, their scopes are “request” and I have session bean with some state for performing a conversation. Before I used Struts2 session map, but I wanted the “containsKey, put, get, cast” nightmare to dissapear. So I started using session scope bean managed by Spring.
Question: this bean isn’t thread-safe? If we have multiple-windows-per-user-per-browser, we can get many threads in session bean? How to handle it? Build thread-safe session bean?
Yes. Everything stored in a scope larger than request is potentially accessed by multiple threads, and must be thread-safe.