Leon:

It's interesting what you've found in the docs, but I fail to see how it can be the application's responsibility to manage concurrent access to the session. I think maybe this text is intended to assign responsibility for non-container shared resources. Since it is possible for more than one servlet to concurrently service requests for a single session-holder, Struts itself simply can't intercede to guarantee that all access to the session is thread-safe. Imagine simply a frameset which has several JSPs (each its own servlet, remember), each of which is perhaps doing a little more that is considered good practice in a JSP and attempting to modify the session.

I would bet money that the authors of the text you quote are intending to warn about access to shared resources that you design yourself: things you may place in the session or application context, but not those contexts themselves.

Joe


Controlling Concurrent Access to Shared Resources

In a multithreaded server, it is possible for shared resources to be
accessed concurrently. In addition to scope object attributes, shared
resources include in-memory data (such as instance or class variables) and
external objects such as files, database connections, and network
connections. Concurrent access can arise in several situations:
...

When resources can be accessed concurrently, they can be used in an
inconsistent fashion. To prevent this, you must control the access using the
synchronization techniques described in the Threads lesson in The Java
Tutorial, by Mary Campione et al. (Addison-Wesley, 2000).


The point is:
To prevent this, _YOU_ must control the access using the synchronization
techniques


And in this case "YOU" is struts. At least struts could do it. At least
optional.
Sure, it will not give you 100% guarantee, but if struts would provide
methods for thread-safe session handling and be thread-safe itself, wouldn't
it be lot easier for the users to code thread-safe webapps?


Regards
Leon

P.S. If you say NO again, I will not spam you with this topic anymore.
Promised :-)



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


--
Joe Germuska [EMAIL PROTECTED] http://blog.germuska.com "Narrow minds are weapons made for mass destruction" -The Ex

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to