Return-Path: Delivered-To: apmail-jakarta-tomcat-user-archive@www.apache.org Received: (qmail 93544 invoked from network); 7 Oct 2003 13:01:30 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 7 Oct 2003 13:01:30 -0000 Received: (qmail 56282 invoked by uid 500); 7 Oct 2003 13:00:52 -0000 Delivered-To: apmail-jakarta-tomcat-user-archive@jakarta.apache.org Received: (qmail 56223 invoked by uid 500); 7 Oct 2003 13:00:52 -0000 Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tomcat Users List" Reply-To: "Tomcat Users List" Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 56079 invoked from network); 7 Oct 2003 13:00:50 -0000 Received: from unknown (HELO ttmail.tduk.com) (212.137.63.82) by daedalus.apache.org with SMTP; 7 Oct 2003 13:00:50 -0000 Received: by ttmail.tduk.com (Postfix, from userid 65534) id 408263B8F6; Tue, 7 Oct 2003 14:00:08 +0100 (BST) Received: from localhost (localhost [127.0.0.1]) by ttmail.tduk.com (Postfix) with ESMTP id 725073BD41 for ; Tue, 7 Oct 2003 14:00:07 +0100 (BST) Received: from ttmail.tduk.com (localhost [127.0.0.1]) by localhost (VaMailArmor-2.0.1.14) id 25561-7C1E74C4; Tue, 07 Oct 2003 14:00:07 +0100 Received: from pguyatt2 (unknown [212.137.61.210]) by ttmail.tduk.com (Postfix) with ESMTP id 1B4CB3B8BC for ; Tue, 7 Oct 2003 14:00:07 +0100 (BST) From: "Peter Guyatt" To: "Tomcat Users List" Subject: RE: Accessing objects with any servlets, where the object is already pre-created Date: Tue, 7 Oct 2003 14:00:25 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.6604 (9.0.2911.0) X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 Importance: Normal In-Reply-To: <00f101c38d9c$119f1a00$6600a8c0@temple> X-AntiVirus: checked by Vexira MailArmor (version: 2.0.1.14; VAE: 6.21.0.1; VDF: 6.21.0.58; host: ttmail.tduk.com) X-Spam-Status: No, hits=-8.7 required=5.0 tests=AWL,BAYES_30,IN_REP_TO,MSGID_GOOD_EXCHANGE, ORIGINAL_MESSAGE,QUOTED_EMAIL_TEXT version=2.55 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.55 (1.174.2.19-2003-05-19-exp) X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Hi there, It will be a direct reference thanks Pete -----Original Message----- From: Vidar Langberget [mailto:vidar@langberget.com] Sent: 08 October 2003 14:00 To: Tomcat Users List Subject: Re: Accessing objects with any servlets, where the object is already pre-created I understand that you can't put every object you want to cache in the servletcontext, and a holder/wrapper object is needed. But you still need to call servletContext.getAttribute() once for every request. The question is: Does it matter performance-wise if the objects you store in the servletContext are large or small. Ie, when you have the following code: CacheManager cm = (CacheManager)servletContext.getAttribute("cache"): FineObj fo = (FineObj)cm.getObject(key); .. Is cm object getting a reference to the cache attribute(fast), or a copy of the object stored there(slow)? Sorry for not making my question clearer. regards, Vidar ----- Original Message ----- From: "Tim Funk" > The easy workaround is not store *many* objects into the servletContext but > to store a "holder object" into the servletContext. > > Rehashing is a non-issue if at initialization time all the information is > loaded into the servletContext. If not future writes are done into the > servlet context, then no rehashing is done. > > In fact, you can have one object in your servletContext which holds ALL of > your data. Then you have full control of the hashing issues and don't need to > worry about excessive calls to (CAST)servletContext.getAttribute() or worry > about static variables. > --------------------------------------------------------------------- To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: tomcat-user-help@jakarta.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: tomcat-user-help@jakarta.apache.org