Return-Path: Delivered-To: apmail-jakarta-jcs-users-archive@www.apache.org Received: (qmail 1758 invoked from network); 25 Jul 2005 14:48:02 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 25 Jul 2005 14:48:02 -0000 Received: (qmail 11806 invoked by uid 500); 25 Jul 2005 14:48:02 -0000 Delivered-To: apmail-jakarta-jcs-users-archive@jakarta.apache.org Received: (qmail 11663 invoked by uid 500); 25 Jul 2005 14:48:01 -0000 Mailing-List: contact jcs-users-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "JCS Users List" Delivered-To: mailing list jcs-users@jakarta.apache.org Received: (qmail 11650 invoked by uid 99); 25 Jul 2005 14:48:00 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 25 Jul 2005 07:48:00 -0700 X-ASF-Spam-Status: No, hits=0.9 required=10.0 tests=DNS_FROM_RFC_ABUSE,DNS_FROM_RFC_WHOIS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of Aaron.Smuts@travelocity.com designates 151.193.220.19 as permitted sender) Received: from [151.193.220.19] (HELO sgtulmg02.sabre.com) (151.193.220.19) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 25 Jul 2005 07:47:53 -0700 Received: from unknown (HELO sghdqbh02.Global.ad.sabre.com) (10.12.64.4) by sgtulmg02.sabre.com with ESMTP; 25 Jul 2005 09:47:52 -0500 X-IronPort-AV: i="3.95,140,1120453200"; d="scan'208"; a="548775844:sNHT2001669932" Received: from sgtulmsp04.Global.ad.sabre.com ([10.12.64.107]) by sghdqbh02.Global.ad.sabre.com with Microsoft SMTPSVC(6.0.3790.0); Mon, 25 Jul 2005 09:47:52 -0500 X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: How to implement write-thru caching with JCS? Date: Mon, 25 Jul 2005 09:47:51 -0500 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: How to implement write-thru caching with JCS? Thread-Index: AcWQvcmCAHWA/3PhT8G0pnMQ3NzZbAAaRzhQ From: "Smuts, Aaron" To: "JCS Users List" , "Prasad xyz" X-OriginalArrivalTime: 25 Jul 2005 14:47:52.0471 (UTC) FILETIME=[D5AF3A70:01C59127] X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N It's not perfectly clear to me what you're asking. In any case, it looks like you have too much code in your jsp pages, which in my experience leads to big problems. Why don't you create a common data access layer and control the caching there. When you add records you can invalidate related cache entries, etc. If you follow an MVC pattern then you would probably already have such a layer. Given your current code, can't you just clean up whatever lists jsp1 uses in jsp2? Aaron > -----Original Message----- > From: Prasad xyz [mailto:pvjava@gmail.com] > Sent: Sunday, July 24, 2005 10:08 PM > To: jcs-users@jakarta.apache.org > Subject: How to implement write-thru caching with JCS? >=20 > Hi folks, >=20 > I have a simple jsp which displays a really huge table (10k+ rows), > the jsp just invokes a bean which does all the query execution and > populates & returns an arraylist based on the resultset object: >=20 > //this is within jsp1 > >=20 > <% > //this method executes the query and > populates & returns an arraylist object > ArrayList result =3D display.showTable(); > %> >=20 > //loop thru the arraylist to render the table >=20 > > <% > for(int i=3D0; i out.println(((StringBuffer)result.get(i)).toString()); > } > %> >
>=20 > I am planning to use JCS to cache the arraylist object so that I avoid > issuing a fresh query everytime a user hits jsp1. >=20 > I also have another jsp which writes to the same table, so the underlying > table is modified every time a user inputs data using the other jsp (jsp2) >=20 > My question is - how would I do write-thru caching in this scenario? > if a user hits jsp1 and the arraylist object is cached, then user goes > to jsp2 and updates some data, I want the cache to realise that the > underlying table got modified and dynamically refresh the cached > arraylist object by calling display.showTable(), so now when the > user goes back to jsp1 then the updated data is instantly served > from the cache, is it possible to do something like this in JCS? >=20 > I would appreciate any help on this, thanks in advance! >=20 > --------------------------------------------------------------------- > To unsubscribe, e-mail: jcs-users-unsubscribe@jakarta.apache.org > For additional commands, e-mail: jcs-users-help@jakarta.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: jcs-users-unsubscribe@jakarta.apache.org For additional commands, e-mail: jcs-users-help@jakarta.apache.org