From user-return-24393-archive-asf-public=cust-asf.ponee.io@ignite.apache.org Mon Jan 21 12:42:19 2019 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 61247180627 for ; Mon, 21 Jan 2019 12:42:18 +0100 (CET) Received: (qmail 62892 invoked by uid 500); 21 Jan 2019 11:42:17 -0000 Mailing-List: contact user-help@ignite.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@ignite.apache.org Delivered-To: mailing list user@ignite.apache.org Received: (qmail 62882 invoked by uid 99); 21 Jan 2019 11:42:17 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 21 Jan 2019 11:42:17 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id D0483C0412 for ; Mon, 21 Jan 2019 11:42:16 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.798 X-Spam-Level: * X-Spam-Status: No, score=1.798 tagged_above=-999 required=6.31 tests=[DKIMWL_WL_MED=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd4-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id KfNBW3JAtbYh for ; Mon, 21 Jan 2019 11:42:15 +0000 (UTC) Received: from mail-ua1-f67.google.com (mail-ua1-f67.google.com [209.85.222.67]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id 03DC660EEB for ; Mon, 21 Jan 2019 11:42:15 +0000 (UTC) Received: by mail-ua1-f67.google.com with SMTP id z11so6786995uaa.10 for ; Mon, 21 Jan 2019 03:42:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=zOctzLPhcdWmYbKyRBp+ExKrQWECxu8Wz6WAc2tnl20=; b=MD2QNBEZVOrRMPLddd+IOBr5GFIjQGkC4hGjTX2QxUhIrX2Ite8fwLqbGntUVZzWGu FOvWMTaI8Jk8YbLnYHj8J+s5y4MO7t7Dl7cPvFPLdFyi9x5Uxl9pMPceqkDxMjF4064w buIf+M0YrIxrF/YV44HkSprOxJuPMq2PXApWsSEkra1KbaVz42X3virt/+fqghPojqtt VOrX99rySmOMouKRgLDaxdD3K2CETLpdkFe/ATfyDikjY45TYSVUQ2U3HEehRlZV0pyf 39Vx+nbyGQhCwyvxqo0hyg3GggyFbYyXpcc1eB4UTrhI8Ut+Cz4sj2lfxpRkOqjdg286 qVcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=zOctzLPhcdWmYbKyRBp+ExKrQWECxu8Wz6WAc2tnl20=; b=fb0c2mbcpgks4arJbxbIyNCW/SLdyobbmfOpR44Ek8nKvB/imeVo7wT9hc/CbX8sb5 ymHfbM5DIKKzlX8aQ/v6jlrCH0HWTpKJo8NMRo9TipMTtXH8SRHXCoXcCh6RvOBe1lHR 2k79oSjkdW8tr/BBXSeQ9sPdmTbM3ivaz4IjaGG/WcK6FpnhdtQDtm2+SmWzMTqTBSOj LNyymW0qHUArlywMwLw98TYcC0EItYk9LnBMzbbQ6hdP/Qekd7VMdLffwWnM1XMHS5s/ SSvUEYi/cCsyXXOL9IA4sO9HgIMcm7V9wryjNVmrCtb+7ptJrAcvH1JRP1ppiL6/71+r +dzg== X-Gm-Message-State: AJcUukcv8h/LzXC7soYzWin2+ryC5NEzSs4xAQ7KWgcxrcn3OSbMe2ny Iq79CHxrCpEKDUslBLibysWxpSO7m4FnpK7rjl+ntt1R X-Google-Smtp-Source: ALg8bN5nn0d9L2p5W5PiCVxgGudy+k1ZxAbdRAI1hG4Pez8FdgLyaQortrXF9qj9NZXhq2BaDk/e7S+c4D/ZQvpCv3c= X-Received: by 2002:ab0:6790:: with SMTP id v16mr11855480uar.95.1548070927894; Mon, 21 Jan 2019 03:42:07 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Ilya Kasnacheev Date: Mon, 21 Jan 2019 14:41:56 +0300 Message-ID: Subject: Re: update Object type value of entry in EntryProcessor within transaction does not work To: user@ignite.apache.org Cc: yeahch2011@gmail.com Content-Type: multipart/alternative; boundary="000000000000be8eeb057ff659e3" --000000000000be8eeb057ff659e3 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hello! I was able to run your first & second fragments with expected behavior: Entity{id=3D'hello3', value=3D'v3', date=3D2019-01-21} Note that I'm using 2.7. Regards, --=20 Ilya Kasnacheev =D0=BF=D0=BD, 21 =D1=8F=D0=BD=D0=B2. 2019 =D0=B3. =D0=B2 08:43, c c : > Hi, > I work on ignite 2.7.0 > > I have a value type as below > > public class Entity { > String id; > String value; > Date date; > } > > then interact with cache as below > > try (Transaction tx =3D > ignite.transactions().txStart(TransactionConcurrency.PESSIMISTIC, > TransactionIsolation.SERIALIZABLE)) { > cache1.invoke("k6", new EntryProcessor() { > @Override public Object process(MutableEntry > mutableEntry, Object... objects) throws EntryProcessorException { > Entity e =3D mutableEntry.getValue(); > e.setId("hello3"); > e.setValue("v3"); > mutableEntry.setValue(e); > return null; > } > }); > tx.commit(); > } > > But entry value does not change after commit. > > If i code as below, entry value would change after commit. > > try (Transaction tx =3D > ignite.transactions().txStart(TransactionConcurrency.PESSIMISTIC, > TransactionIsolation.SERIALIZABLE)) { > cache1.invoke("k6", new EntryProcessor() { > @Override public Object process(MutableEntry > mutableEntry, Object... objects) throws EntryProcessorException { > mutableEntry.setValue(new Entity("test2", "a2", new Date())); > return null; > } > }); > tx.commit(); > } > > I found that changes to entry would not take effect after commit when > mutableEntry.getValue() called. > --000000000000be8eeb057ff659e3 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hello!

I wa= s able to run your first & second fragments with expected behavior:

Entity{id=3D'hello3', value=3D'v3', d= ate=3D2019-01-21}

Note that I'm using 2.7.

Regards,
--
Ilya Kasnacheev


=D0=BF=D0=BD, 21 =D1=8F=D0=BD=D0=B2. 2019 =D0=B3. =D0=B2 08:43, c c <<= a href=3D"mailto:yeahch2011@gmail.com">yeahch2011@gmail.com>:
= Hi,
=C2=A0 I work on ignite 2.7.0

=C2=A0 I have a value type as below

public class Entity {
=C2=A0=C2=A0=C2=A0=C2=A0 String id;
=C2=A0=C2=A0=C2=A0=C2=A0 String value;
=C2=A0=C2=A0=C2=A0=C2=A0 Date date;
}

then interact with cache as below

try (Transaction tx =3D
=C2=A0=C2=A0=C2=A0=C2=A0 ignite.transactions().txStart(TransactionConcurren= cy.PESSIMISTIC,
TransactionIsolation.SERIALIZABLE)) {
=C2=A0=C2=A0=C2=A0=C2=A0 cache1.invoke("k6&quo= t;, new EntryProcessor<String, Ent= ity, Object>() {
=C2=A0=C2=A0=C2=A0=C2=A0 @Override=C2=A0=C2= =A0=C2=A0=C2=A0 public Object process(Mutabl= eEntry<String, Entity> mutableEntry, Object... objects) throws EntryProcessorException {
=C2=A0=C2=A0=C2=A0=C2=A0 Entity e =3D mutableEntry.getValue();
=C2=A0=C2=A0=C2=A0 e.setId("hello3");
=C2=A0=C2=A0=C2=A0 e.setValue("v3"= );
=C2=A0=C2=A0=C2=A0 mutableEntry.setValue(e);
=C2=A0=C2=A0=C2=A0 return null;
}
});
=C2=A0=C2=A0=C2=A0 tx.commit();
}

But entry value does not change after commit.

If i code as below, entry value would change after commit.

try (Transaction tx =3D
=C2=A0=C2=A0=C2=A0=C2=A0 ignite.transactions().txStart(TransactionConcurren= cy.PESSIMISTIC,
TransactionIsolation.SERIALIZABLE)) {
=C2=A0=C2=A0=C2=A0=C2=A0 cache1.invoke("k6&quo= t;, new EntryProcessor<String, Ent= ity, Object>() {
=C2=A0=C2=A0=C2=A0=C2=A0 @Override=C2=A0=C2= =A0=C2=A0=C2=A0 public Object process(Mutabl= eEntry<String, Entity> mutableEntry, Object... objects) throws EntryProcessorException {
=C2=A0=C2=A0=C2=A0 mutableEntry.setValue(new Entity= ("test2", "a2", new Date()));
=C2=A0=C2=A0=C2=A0 return null;
}
});
=C2=A0=C2=A0=C2=A0 tx.commit();
}

I found that changes to entry would not take effect after commit when mu= tableEntry.getValue() called.

--000000000000be8eeb057ff659e3--