Return-Path: X-Original-To: apmail-ignite-dev-archive@minotaur.apache.org Delivered-To: apmail-ignite-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 50A1F10B78 for ; Tue, 20 Jan 2015 15:28:44 +0000 (UTC) Received: (qmail 75439 invoked by uid 500); 20 Jan 2015 15:28:44 -0000 Delivered-To: apmail-ignite-dev-archive@ignite.apache.org Received: (qmail 75402 invoked by uid 500); 20 Jan 2015 15:28:44 -0000 Mailing-List: contact dev-help@ignite.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ignite.incubator.apache.org Delivered-To: mailing list dev@ignite.incubator.apache.org Received: (qmail 75380 invoked by uid 99); 20 Jan 2015 15:28:43 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 20 Jan 2015 15:28:43 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of sboikov@gridgain.com designates 209.85.212.174 as permitted sender) Received: from [209.85.212.174] (HELO mail-wi0-f174.google.com) (209.85.212.174) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 20 Jan 2015 15:28:18 +0000 Received: by mail-wi0-f174.google.com with SMTP id n3so4349807wiv.1 for ; Tue, 20 Jan 2015 07:27:32 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=shxbQ40jDdnBS2SnU/2nEefFIL9UmwMp1WoMyFvXDRs=; b=KzVJNNZ/d7mOKfkAE48cF8fz6+S6mcb0aJO4Oh0BV/nmFb485F5zAVFuNBkPB2ctEJ LcEQmsoaO0wHc+y964Vh22x1EFagqE9EpEs/6pSYTOZzHGJ72otLN8PfQbE3ss9NHNHG 16dKQLhVi7LxwdkJHd+bHTIeZZbkouUavxOTtr09pfL2AZNHzDp71iTWv5fKPKg+tIfR 4hz9qhUklueRFNHxNC+bE7uGP1OtLVe2XuIq1LX3UTwQKaw6uQ6PxLDRTy2heK0GrSOe jt2mQyHhFKibHoN48S2LSuIlEtOjOnAmkYBVYUGFrktudTBtUZ4PvlwCbNPnW4AFE/cu E69g== X-Gm-Message-State: ALoCoQlGr5wJJafVAiTX568HjLUZqW/i1tojPRXquiXvekketX46TikfDvqCs0lxVsgsdMJJkcGZ MIME-Version: 1.0 X-Received: by 10.194.239.134 with SMTP id vs6mr69268177wjc.19.1421767652367; Tue, 20 Jan 2015 07:27:32 -0800 (PST) Received: by 10.180.39.174 with HTTP; Tue, 20 Jan 2015 07:27:32 -0800 (PST) In-Reply-To: References: Date: Tue, 20 Jan 2015 18:27:32 +0300 Message-ID: Subject: Re: JCache read-through behavior From: Semyon Boikov To: dev@ignite.incubator.apache.org Content-Type: multipart/alternative; boundary=089e01493b40df8204050d1713ca X-Virus-Checked: Checked by ClamAV on apache.org --089e01493b40df8204050d1713ca Content-Type: text/plain; charset=UTF-8 This behavior is clearly stated in JCache spec, also there are corresponding TCK tests (see CacheLoaderTest.shouldNotLoadUsingPutIfAbsent, CacheLoaderTest.shouldNotLoadUsingGetAndPut). On Tue, Jan 20, 2015 at 6:19 PM, Dmitriy Setrakyan wrote: > Are we absolutely certain that this is indeed the JCache behavior and not > our misconfiguration? Do we have CacheLoader and CacheWriter configured and > isWriteThrough() and isReadThrough() flags enabled? > > If yes, then we should probably have a configuration property to enable and > disable such behavior. How about isReadThroughPreviousValue()? > > D. > > On Tue, Jan 20, 2015 at 6:44 AM, Alexey Kuznetsov > > wrote: > > > But what will happen if user select Ignite to replace some JCache > > implementation in his production application? > > He may get unexpected behaviour. Or not? > > > > I think we should change current implementation to conform to JCache for > > compatibility with other implementations and have configuration option > for > > our current implementation. > > > > On Tue, Jan 20, 2015 at 4:49 PM, Semyon Boikov > > wrote: > > > > > Hi all, > > > > > > I'm implementing support for JCache CacheLoader and found that > according > > to > > > JCache specification read-through behavior differs from current Ignite > > > implementation for some cases: > > > - in current Ignite implementation for 'putIfAbsent(K key, V > value)' > > if > > > value is not in cache then it is loaded from store, but in JCache > > > CacheLoader should not be called in this case (the same for replace(K > > key, > > > V oldValue, V newValue), replace(K key, V oldValue), remove(K key, V > > > oldValue)) > > > - in current Ignite implementation if cache method returns previous > > > value (getAndPut, getAndRemove) and value is not in cache then it is > > loaded > > > from store, but in JCache CacheLoader should not be called in this case > > > > > > In my opinion current Ignite behavior is more correct than in JCache > > spec. > > > Do you think we should change current implementation to conform to > > JCache? > > > > > > > > > > > -- > > Alexey Kuznetsov > > GridGain Systems > > www.gridgain.com > > > --089e01493b40df8204050d1713ca--