Apache ignite:A key error occurs when putting object data

0

I am trying Apache ignite, but I could not put the object data. The server is a single node in Java. The client is a thin client in .NET(C#).

This version is

Server OS:Ubuntu 18.04

JAVA:openjdk version 11.0.11

ignite:2.10.0

Client OS:Windows 10

.NET:.NET Framework 4.6.2

ignite:2.10.0 (Nuget)

When the client put the object, the following exception is raised.

Apache.Ignite.Core.Client.IgniteClientException
  HResult=0x80131500
  Message=class org.apache.ignite.internal.processors.cache.CachePartialUpdateCheckedException: Failed to update keys (retry update if possible).: [100]
  Source=Apache.Ignite.Core
  Stack Trace:
   at Apache.Ignite.Core.Impl.Client.Cache.CacheClient`2.HandleError[T](ClientStatusCode status, String msg)
   at Apache.Ignite.Core.Impl.Client.ClientSocket.DecodeResponse[T](BinaryHeapStream stream, Func`2 readFunc, Func`3 errorFunc)
   at Apache.Ignite.Core.Impl.Client.ClientSocket.DoOutInOp[T](ClientOp opId, Action`1 writeAction, Func`2 readFunc, Func`3 errorFunc)
   at Apache.Ignite.Core.Impl.Client.Cache.CacheClient`2.DoOutInOpAffinity[T](ClientOp opId, TK key, TV val, Func`2 readFunc)
   at Apache.Ignite.Core.Impl.Client.Cache.CacheClient`2.Put(TK key, TV val)
   at ignitetest.IgniteClientTest.EntityTest() in D:\SandboxRepos\dbtest\ignitetest\IgniteClientTest.cs:line 58
   at ignitetest.Program.Main(String[] args) in D:\SandboxRepos\dbtest\ignitetest\Program.cs:line 14

The same exception occurred on the server.

[17:42:15,212][SEVERE][client-connector-#66][ClientListenerNioListener] Failed to process client request [req=o.a.i.i.processors.platform.client.cache.ClientCachePutRequest@54fb9e8b]
javax.cache.integration.CacheWriterException: class org.apache.ignite.internal.processors.cache.CachePartialUpdateCheckedException: Failed to update keys (retry update if possible).: [100]
...
Caused by: class org.apache.ignite.internal.processors.cache.CachePartialUpdateCheckedException: Failed to update keys (retry update if possible).: [100]

The configuration file for ignite is as follows:

<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="
       http://www.springframework.org/schema/beans
       http://www.springframework.org/schema/beans/spring-beans.xsd">
    <bean id="grid.cfg" class="org.apache.ignite.configuration.IgniteConfiguration">
        <property name="workDirectory" value="/usr/lib/ignite/ignite-data"/>
        <property name="cacheConfiguration">
            <list>
                <bean class="org.apache.ignite.configuration.CacheConfiguration">
                    <constructor-arg name="name" value="PatientCache"></constructor-arg>
                    <property name="cacheStoreFactory">
                        <bean
                            class="org.apache.ignite.cache.store.jdbc.CacheJdbcBlobStoreFactory">
                            <property name="dataSourceBean" value="postgresDataSouorceTestdb" />
                            <property name="createTableQuery" value="create table if not exists ENTRIES (akey bytea primary key, val bytea)" />
                        </bean>
                    </property>
                    <property name="writeThrough" value="true" />
                    <property name="readThrough" value="true" />
                </bean>
            </list>
        </property>
        <property name="binaryConfiguration">
            <bean class="org.apache.ignite.configuration.BinaryConfiguration">
                <property name="compactFooter" value="true"/>
                <property name="classNames">
                        <list>
                            <value>ignitetest.Patient</value>
                        </list>
                </property>
                <property name="nameMapper">
                    <bean class="org.apache.ignite.binary.BinaryBasicNameMapper">
                        <property name="simpleName" value="true"/>
                    </bean>
                </property>
            </bean>
        </property>
    </bean>
    <!-- <bean id="postgresDataSouorceTestdb" class="org.postgresql.ds.PGPoolingDataSource">...</bean> -->
</beans>

The client source is as follows:

var cfg = new IgniteClientConfiguration {
    Endpoints = new[] { "10.1.1.1:10800" },
    BinaryConfiguration=new BinaryConfiguration() {
        CompactFooter=true,
        NameMapper= new BinaryBasicNameMapper { IsSimpleName = true }
    }
};

using (var client = Ignition.StartClient(cfg)) {
    client.GetBinary().GetBinaryType(typeof(Patient));
    var cache = client.GetOrCreateCache<string, Patient>("PatientCache");
    var pat = new Patient() { PatientId = "100", Name = "Test", Birthday = new DateTime(1980,5,1) };
    pat.Birthday = pat.Birthday.ToUniversalTime();
    cache.Put("100", pat);
}

using (var client = Ignition.StartClient(cfg)) {
    var cache = client.GetOrCreateCache<string, Patient>("PatientCache");
    var pat = cache.Get("100");
    System.Diagnostics.Debug.WriteLine("Patient:{0},{1},{2}",pat.PatientId,pat.Name,pat.Birthday);
}

When the data to be registered is a string, it was registered successfully. I am having trouble figuring out what is causing this.

ignite
asked on Stack Overflow May 12, 2021 by Y.Yama

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0