java - Do @SessionScoped beans have concurrency issues? -


obviously, it's easy have multiple parallel requests accessing same @sessionscoped bean in web app context. correct in believing have explicitly control synchronization when accessing @sessionscoped bean within requests?

depends on mean by:

explicitly control synchronization when access @sessionscoped bean within requests

you right there may several threads accessing @sessionscoped bean in parallel. have take care of thread safety. whether need explicitly control synchronization (or synchronize @ all) depends on how shared state used or modified different threads. if use classes java.util.concurrent or java.util.concurrent.atomic, may achieve perfect thread-safety without single synchronized statement.

but yes, have take care of thread safety.


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -