Return-Path: Delivered-To: apmail-jakarta-jcs-dev-archive@www.apache.org Received: (qmail 12370 invoked from network); 10 Nov 2005 01:00:18 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 10 Nov 2005 01:00:18 -0000 Received: (qmail 87901 invoked by uid 500); 10 Nov 2005 01:00:18 -0000 Delivered-To: apmail-jakarta-jcs-dev-archive@jakarta.apache.org Received: (qmail 87886 invoked by uid 500); 10 Nov 2005 01:00:17 -0000 Mailing-List: contact jcs-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "JCS Developers List" Delivered-To: mailing list jcs-dev@jakarta.apache.org Received: (qmail 87875 invoked by uid 99); 10 Nov 2005 01:00:17 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Nov 2005 17:00:17 -0800 X-ASF-Spam-Status: No, hits=0.5 required=10.0 tests=DNS_FROM_RFC_ABUSE X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [68.142.200.119] (HELO web30506.mail.mud.yahoo.com) (68.142.200.119) by apache.org (qpsmtpd/0.29) with SMTP; Wed, 09 Nov 2005 17:00:10 -0800 Received: (qmail 24072 invoked by uid 60001); 10 Nov 2005 00:59:56 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Received:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=3v61x95SjBFn42PgwB8xLijVtnGnGBTST5O5HTvm39l9hEr+q7qBXMs3XwMlxV/cWUvUT2R4/5o4xXcXYdq8QvxL3lwqG5YsKmdmRoW+A5+LLNIPkIFMKnyJnFcA9bD1gtsAyd/JRa8Iy15iExycaTFsyTeCWY3MwpZRayhZINo= ; Message-ID: <20051110005956.24070.qmail@web30506.mail.mud.yahoo.com> Received: from [24.90.255.112] by web30506.mail.mud.yahoo.com via HTTP; Wed, 09 Nov 2005 16:59:56 PST Date: Wed, 9 Nov 2005 16:59:56 -0800 (PST) From: Aaron Smuts Subject: Re: Lateral Cache Problems due to ObjectOutputStream Reset frequency To: JCS Developers List In-Reply-To: <0CAE73CC2160A94E99E50C033C95567F09131B@smail5.ebworx.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N This is strange. Can you try on jdk1.4 or above and see if you get the same problem? Does it happen every time? Aaron --- Benjamin Foo wrote: > Hi JCS developers, > > Recently, I've encountered a wierd behaviour > regarding the synchronising of data across lateral > caches. The problem occurs when a given LateralCache > begins streaming the LateralElementDescriptor object > to other laterals. It is discovered that the > CacheElement.val property tends to reuse the value > of a previously sent led (where the keys are the > same). Following is an example of how caches will > become unsynchornised: > > LateralCache1 sends led (key="MyKey", > value="MyValue1") > > LateralCache2 received led (key="MyKey", > value="MyValue1") > > LateralCache1 sends led (key="MyKey", > value="MyValue1,MyValue2") > > LateralCache2 received led (key="MyKey", > value="MyValue1") > > > I attempted to address this behaviour by adding in > some debugging code: > > In the try-catch block just before > ObjectOutputStream writes the object > > oos.writeObject( led ); > > I added some debugging code at the send method > > //** Ben DEBUG Code (09/11/2005) > if ( log.isDebugEnabled() ) > { > log.debug( "BEN: Sending > LateralElementDescriptor to other laterals " + "led > = " + led + ", led.command = " + led.command + ", > led.ce = " + led.ce ); > } > > Output is: > > BEN: Sending > LateralElementDescriptor to other laterals led = > org.apache.jcs.auxiliary.lateral.LateralElementDescriptor@451523 > > , led.command = 1, led.ce = > [cacheName=DSMSDataCache, key=LoginValue-GROUPKEY, > val=[74398d770ac5c563005ae9d6c8b00087, > 7436cea60ac5c563005ae9d6a093a373], attr = [ > IS_LATERAL = true, IS_SPOOL = true, IS_REMOTE = > true, IS_ETERNAL = false, MaxLifeSeconds = -1, > IdleTime = -1, CreateTime = 1131526327671, > LastAccessTime = 1131526327671, > getTimeToLiveSeconds() = -1, createTime = > 1131526327671 ]] > > > To my surprise, before writing the object, the led > value is correct, but at the receiving end at the > LateralTCPListener, in the Thread's run method, the > ObjectInputStream reads a stale value: > > led = (LateralElementDescriptor) ois.readObject(); > > Output is: > > receiving > LateralElementDescriptor from anotherled = > org.apache.jcs.auxiliary.lateral.LateralElementDescriptor@5d3aec > > , led.command = 1, led.ce = > [cacheName=DSMSDataCache, key=LoginValue-GROUPKEY, > val=[7436cea60ac5c563005ae9d6a093a373], attr = [ > IS_LATERAL = true, IS_SPOOL = true, IS_REMOTE = > true, IS_ETERNAL = false, MaxLifeSeconds = -1, > IdleTime = -1, CreateTime = 1131526327671, > LastAccessTime = 1131526327671, > getTimeToLiveSeconds() = 16, createTime = > 1131526327671 ]] > > > I decided to change the constant value for > RESET_FREQUENCY of the LateralTCPSender class to 1 > (reset after every send), and the LateralCaches no > longer have unsynchornised values. > > Is there any impact to the performance of JCS by > doing this? Could this be a minor fault with the JDK > (I'm running on JDK131)? > > > > Benjamin Foo > Technical Lead > Kasikornbank CMAS Corporate Project > > On-site Project Address > 9th Floor (Special Projects Department) > Kasikornbank PCL > 1 Soi Kasikornthai > Ratburana Road > 10140 Bangkok > Thailand > > Head Office Address > eBworx Berhad > 7th Floor Menara Merais > 1 Jalan 19/3 > 46300 Petaling Jaya > Selangor DE > Malaysia > > Tel: (+6)03-7956 9822 > Fax: (+6)03-7957 2661 > Mobile: (+6)016-330 0565 (Malaysia) > Mobile: (+66)4-656 1719 (Thailand) > Email: benjaminfoo@ebworx.com > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: > jcs-dev-unsubscribe@jakarta.apache.org > For additional commands, e-mail: > jcs-dev-help@jakarta.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: jcs-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: jcs-dev-help@jakarta.apache.org