> -----Ursprüngliche Nachricht-----
> Von: Craig McClanahan [mailto:[EMAIL PROTECTED] 
> Gesendet: Mittwoch, 7. September 2005 01:38
> An: Struts Developers List
> Betreff: Re: How ThreadSafe are struts-taglibs, or do we want 
> them threadsafe?
> 
> On 9/6/05, Leon Rosenberg <[EMAIL PROTECTED]> wrote:
> > 
> > 
> > Sorry Graig, I looked into the source; yes, it has your name in it, 
> > and no, it is not thread safe (jakarta-tomcat-5.0.25-src)
> 
> 
> Looks like they did change it. Go look at the corresponding 
> code in 4.1 to see what I was talking about :-).
> 
> [snip]
> 
> > 
> > Ok, other suggestion, lets talk to the tomcat people, that they fix 
> > the bug, or at least add a party synchronized version of 
> > add/get/remove attribute.
> 
> 
> That's the right answer ... or, more precisely, start by 
> filing a bug against it (http://issues.apache.org/bugzilla). 
> 


After we agreed that this is a bug, I have to disappoint you again, and tell
you, that this is NOT a bug.
According to the servlet spec, the webapp has to control access to the
session, not the container. To quote the jdk1.4 tutorial:
(http://java.sun.com/j2ee/1.4/docs/tutorial/doc/index.html, chapter 11)

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]

Reply via email to