What are the multithreading and clustering issues when it comes to using beans with jsp's in differrent scopes?

Serge Knystautas

With respective to multithreading, beans that are created with a request or page scope are new instances for each JSP call so these beans need not be thread safe. Beans that are created with a session or application scope must be thread safe as multiple pages could be accessing the same bean at once. In either case, if beans are accessing shared resources (like pooling connections behind the scene), you must make sure this sharing is thread-safe

Clustering has similar issues as multithreading. Again, request and page scope beans are generally fine as they're created with each page request, but session and application will be shared instances. The clustering package you are using will often give you the ability to use the same session or application object across clustered servers, and this is either handled by keeping the objects in a shared ATOMic location (like a database) or each clustered server accessing the single instance of the objects via RMI.