Hello Tomcat people

For those not wishing to migrate at this time to 5.5.12
(in our case, from 5.0.28 and jdk 1.4) would the following
be sufficient for preventing deadlock access of the session
objects ?

In a given servlet, say, ServletA, for example, might have:

    HttpSession session = getSessionCheckValid( request );

    synchronized( session )  {
        session.setAttribute( particularAttribName,
                              particularAttribVal );
    }

The question arises, if this session obj is being used from
a variety of such servlets, does the above code in ServletA
prevent simultaneous access to the set method of the same obj
in a similar synchronized block in some other servlet, say,
in ServletB ?

If, on the other hand, one chooses to write a class extending
the HttpSession interface, and then (2) wrap the get/set and other applicable methods with synchonized methods, then what is the
minimum amount of threading machinery that must to be provided
(i.e., Runnable, run(), etc) to accomplish this wrapping ?

For that matter, has someone done this who would be willing
to share such code ?


Maurice Yarrow


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

Reply via email to