tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vikramjit Singh <vikramj...@gtllimited.com>
Subject RE: ServletContext object
Date Fri, 13 Sep 2002 11:14:47 GMT
> -----Original Message-----
> From: Santosh Kulkarni [mailto:sant_kulkarni@yahoo.com]
> Sent: Friday, September 13, 2002 2:13 AM
> To: tomcat-user@jakarta.apache.org
> Subject: ServletContext object
> 
> 
> Are the objects put in ServletConext synchronized? 

No they are not synchronized. Many users can concurrently access
ServletContext instance.
You could implement the SingleThreadModel in a servlet for gaining the
purpose of synchronization.

> Say I have a ServletContext ctx. If I do,
> ctx.setAttribute("MYOBJECT", hashTableObject);
> where hashTableObject is a Hashtable (or any other
> instantiated object) then is the object
> hashTableObject synchronized both for reads and
> writes?

Hashtable is synchronized unlike the Collections implementation.
I hope i get you correctly.

> TIA
> Santosh

Vikram.
> 
> __________________________________________________
> Do you Yahoo!?
> Yahoo! News - Today's headlines
> http://news.yahoo.com
> 
> --
> To unsubscribe, e-mail:   
> <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: 
> <mailto:tomcat-user-help@jakarta.apache.org>
> 

--
To unsubscribe, e-mail:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-user-help@jakarta.apache.org>


Mime
View raw message