Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id D0134200D14 for ; Tue, 3 Oct 2017 15:43:28 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id CEA181609DD; Tue, 3 Oct 2017 13:43:28 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 1F9FA1609D2 for ; Tue, 3 Oct 2017 15:43:27 +0200 (CEST) Received: (qmail 78858 invoked by uid 500); 3 Oct 2017 13:43:27 -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 78848 invoked by uid 99); 3 Oct 2017 13:43:27 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Oct 2017 13:43:27 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 31BCFDF4A6 for ; Tue, 3 Oct 2017 13:43:26 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.8 X-Spam-Level: * X-Spam-Status: No, score=1.8 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, SPF_HELO_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id 4JnxUiGRbr7F for ; Tue, 3 Oct 2017 13:43:24 +0000 (UTC) Received: from n6.nabble.com (n6.nabble.com [162.255.23.37]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id A86BF5FDE0 for ; Tue, 3 Oct 2017 13:43:23 +0000 (UTC) Received: from n6.nabble.com (localhost [127.0.0.1]) by n6.nabble.com (Postfix) with ESMTP id 089D3209698B for ; Tue, 3 Oct 2017 06:43:23 -0700 (MST) Date: Tue, 3 Oct 2017 06:43:23 -0700 (MST) From: siva To: user@ignite.apache.org Message-ID: <1507038203033-0.post@n6.nabble.com> In-Reply-To: References: <1507033667436-0.post@n6.nabble.com> Subject: Re: Persistence store(MSSQL) using cross-platform c#(Ignite Client windows) and java(Ignite Server linux version) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit archived-at: Tue, 03 Oct 2017 13:43:29 -0000 Hi Alexey, Here is the code snippet, client config ===============> var cfg = new IgniteConfiguration { BinaryConfiguration = new BinaryConfiguration { NameMapper = new BinaryBasicNameMapper { IsSimpleName = true }, } }; var customersCache = ignite.GetOrCreateCache(new CacheConfiguration { Name = "customer12" + tenantName, KeepBinaryInStore = false, CacheStoreFactory = new CustomerCacheStoreFactory(connectionString), ReadThrough = true, WriteThrough = true, }); customersCache[new Random().Next().ToString()] = new CustomerInfo { Name = tenantName, Id = Id, City = city }; here is the exception when putting into cache its throwing exception. server config: ==============> BinaryConfiguration bcnfg = new BinaryConfiguration(); bcnfg.setNameMapper(new BinaryBasicNameMapper()); IgniteConfiguration cfg = new IgniteConfiguration().setBinaryConfiguration(bcnfg); Ignite ignite=Ignition.start(cfg); Factory implementation ====================================> In C#:(client) ------ [Serializable] class CustomerCacheStoreFactory : IFactory { string connectionString; public CustomerCacheStoreFactory(string connectionString) { this.connectionString = connectionString; } public ICacheStore CreateInstance() { return new CustomerCacheStore(this.connectionString); } } In java(server) ------- public class CustomerCacheStoreFactory implements Factory>{ private String connectionString; public CustomerCacheStoreFactory(String connectionString) { this.connectionString=connectionString; } public CacheStore create() { return new CustomerCacheStore(this.connectionString); } } In Java and c# Cache store where we need to write the logic to persist into sql : =========================================================================== public class CustomerCacheStore implements CacheStore{ load() write() .. .. } Model class in c# to persist ==================================== class CustomerInfo { public CustomerInfo() { } public CustomerInfo(string id,string name,string city) { this.Id = id; this.Name = name; this.City = city; } [Key] [DatabaseGenerated(DatabaseGeneratedOption.None)] public string Id { get; set; } public string Name { get; set; } public string City { get; set; } } Model class in java ================== public class CustomerInfo { final String id; final String name; final String city; public CustomerInfo(String id, String name, String city) { this.id= id; this.name = name; this.city = city; } } -- Sent from: http://apache-ignite-users.70518.x6.nabble.com/