Return-Path: X-Original-To: apmail-ignite-user-archive@minotaur.apache.org Delivered-To: apmail-ignite-user-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 15A4B18EE7 for ; Mon, 11 Apr 2016 05:30:07 +0000 (UTC) Received: (qmail 46329 invoked by uid 500); 11 Apr 2016 05:30:06 -0000 Delivered-To: apmail-ignite-user-archive@ignite.apache.org Received: (qmail 46282 invoked by uid 500); 11 Apr 2016 05:30:06 -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 46272 invoked by uid 99); 11 Apr 2016 05:30:06 -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, 11 Apr 2016 05:30:06 +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 6B945C0295 for ; Mon, 11 Apr 2016 05:30:06 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.173 X-Spam-Level: ** X-Spam-Status: No, score=2.173 tagged_above=-999 required=6.31 tests=[DKIM_ADSP_CUSTOM_MED=0.001, NML_ADSP_CUSTOM_MED=1.2, RCVD_IN_DNSWL_NONE=-0.0001, SPF_SOFTFAIL=0.972] autolearn=disabled 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 n656_MDzQum3 for ; Mon, 11 Apr 2016 05:30:04 +0000 (UTC) Received: from mbob.nabble.com (mbob.nabble.com [162.253.133.15]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 9095E5FAEA for ; Mon, 11 Apr 2016 05:30:03 +0000 (UTC) Received: from malf.nabble.com (unknown [162.253.133.59]) by mbob.nabble.com (Postfix) with ESMTP id D903324EEB69 for ; Sun, 10 Apr 2016 22:17:32 -0700 (PDT) Date: Sun, 10 Apr 2016 22:16:19 -0700 (PDT) From: vkulichenko To: user@ignite.apache.org Message-ID: <1460351779011-4046.post@n6.nabble.com> In-Reply-To: <1460327166768-4042.post@n6.nabble.com> References: <1460060895921-4002.post@n6.nabble.com> <1460071401661-4007.post@n6.nabble.com> <1460079647831-4012.post@n6.nabble.com> <1460087440380-4015.post@n6.nabble.com> <1460143189307-4027.post@n6.nabble.com> <1460152479385-4028.post@n6.nabble.com> <1460327166768-4042.post@n6.nabble.com> Subject: Re: How to perform lazy write to database MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Ignite instance is thread safe, so you can use the same instance to execute separate transactions from different Java threads. No need to start a new node for each transaction. You can do smth like this (pseudocode): try (Transaction tx = ignite.transactions().startTx()) { cache.put(k1, v1); cache.put(k2, v2); new Thread(new Runnable() { try (Transaction tx = ignite.transactions().startTx()) { v1 = cache.get(k1); v2 = cache.get(k2); } }).start(); tx.commit(); } -Val -- View this message in context: http://apache-ignite-users.70518.x6.nabble.com/How-to-perform-lazy-write-to-database-tp4002p4046.html Sent from the Apache Ignite Users mailing list archive at Nabble.com.