Unfortunately it's not our case. Pay attention that you have different PK classes: *com.inspur.edp.qdp.config.api.ketype.PubPartionKeys_1_7* and *com.inspur.edp.qdp.config.keytype.PubPartionKeys_1_7* are different. Also note that BinaryObject to put as PK must have exactly the same fields (count and types) that were defined to create cache. Maybe this will help you.
чт, 7 апр. 2022 г. в 06:28, y <hty1994...@163.com>: > > > Here is my insert code. > > > BinaryObjectBuilder builder = > ignite.binary().builder("com.inspur.edp.caf.db.dbaccess.DynamicResultRow"); > Map<Object, BinaryObject> datasBinary = new HashMap<>(); > IgniteDataStreamer stmr = ignite.dataStreamer("TBDATA_GLFY_1");...... > ...... > > for(int i = 0; i < meta.length; i++){ > builder.setField(meta[i], value[i]); > } > > PubPartionKeys_1_7 pubPartionKeys_1_7 = new PubPartionKeys_1_7( > "cf2d3d93-df0f-dd8d-8038-bac8b54b2042", > "01bc29a3-e82a-a1f2-1afe-ba732910ed72", > "202100102", > "6a4b352a-f5c7-56c6-dfa8-ed501a87d982", > "DA65A696-8C7B-4899-B9D6-85A3F07CD11A", > "aaaeb252-b562-2242-10de-4d6d419f6d56", > "516e4ea5-cb28-37e1-b3ce-439d640370b6"); > datasBinary.put(pubPartionKeys_1_7, builder.build()); > stmr.addData(datasBinary); > stmr.flush(); > stmr.close(); > > 在 2022-04-05 16:56:25,"Vasily A. Laktionov" <vasilylaktio...@gmail.com> > 写道: > > Hi, > It seems we have solved that problem. > We need to see your code where you insert data via BinaryObject and SQL > both. > > сб, 2 апр. 2022 г. в 12:51, y <hty1994...@163.com>: > >> Hi Igniters: >> >> First, I use custom primary key classes and *BinaryObject* to insert >> several pieces of data. And then, when I use the *INSERT* statement to >> insert data, the following error occurs: >> >> *Suppressed: class org.apache.ignite.IgniteCheckedException: Failed to >> update keys on primary node.* >> *at >> org.apache.ignite.internal.processors.cache.distributed.dht.atomic.UpdateErrors.addFailedKeys(UpdateErrors.java:124)* >> *at >> org.apache.ignite.internal.processors.cache.distributed.dht.atomic.GridNearAtomicUpdateResponse.addFailedKeys(GridNearAtomicUpdateResponse.java:340)* >> *at >> org.apache.ignite.internal.processors.cache.distributed.dht.atomic.GridDhtAtomicCache.updateAllAsyncInternal0(GridDhtAtomicCache.java:1918)* >> *... 37 more* >> *Suppressed: class org.apache.ignite.binary.BinaryObjectException: **Failed >> to get field because type ID of passed object differs from type ID this >> BinaryField belongs to [expected=[typeId=-181945856, >> typeName=com.inspur.edp.qdp.config.api.ketype.PubPartionKeys_1_7], >> actual=[typeId=1324872999, >> typeName=com.inspur.edp.qdp.config.keytype.PubPartionKeys_1_7], >> fieldId=-435253668, fieldName=TBDATA_DX01, fieldType=null] **at >> org.apache.ignite.internal.binary.BinaryFieldImpl.fieldOrder(BinaryFieldImpl.java:302)* >> *at >> org.apache.ignite.internal.binary.BinaryFieldImpl.value(BinaryFieldImpl.java:110)* >> *at >> org.apache.ignite.internal.processors.query.property.QueryBinaryProperty.fieldValue(QueryBinaryProperty.java:223)* >> *at >> org.apache.ignite.internal.processors.query.property.QueryBinaryProperty.value(QueryBinaryProperty.java:120)* >> *at >> org.apache.ignite.internal.processors.query.h2.opt.GridH2RowDescriptor.columnValue(GridH2RowDescriptor.java:235)* >> *at >> org.apache.ignite.internal.processors.query.h2.index.QueryIndexRowHandler.getKey(QueryIndexRowHandler.java:110)* >> *at >> org.apache.ignite.internal.processors.query.h2.index.QueryIndexRowHandler.indexKey(QueryIndexRowHandler.java:73)* >> *at >> org.apache.ignite.internal.cache.query.index.sorted.IndexRowImpl.key(IndexRowImpl.java:68)* >> *at >> org.apache.ignite.internal.cache.query.index.sorted.inline.InlineIndexImpl.onUpdate(InlineIndexImpl.java:248)* >> *at >> org.apache.ignite.internal.cache.query.index.IndexProcessor.updateIndex(IndexProcessor.java:452)* >> *at >> org.apache.ignite.internal.cache.query.index.IndexProcessor.updateIndexes(IndexProcessor.java:295)* >> *at >> org.apache.ignite.internal.cache.query.index.IndexProcessor.store(IndexProcessor.java:142)* >> *at >> org.apache.ignite.internal.processors.query.GridQueryProcessor.store(GridQueryProcessor.java:2549)* >> *at >> org.apache.ignite.internal.processors.cache.query.GridCacheQueryManager.store(GridCacheQueryManager.java:422)* >> *at >> org.apache.ignite.internal.processors.cache.IgniteCacheOffheapManagerImpl$CacheDataStoreImpl.finishUpdate(IgniteCacheOffheapManagerImpl.java:2666)* >> *at >> org.apache.ignite.internal.processors.cache.IgniteCacheOffheapManagerImpl$CacheDataStoreImpl.invoke0(IgniteCacheOffheapManagerImpl.java:1742)* >> *at >> org.apache.ignite.internal.processors.cache.IgniteCacheOffheapManagerImpl$CacheDataStoreImpl.invoke(IgniteCacheOffheapManagerImpl.java:1717)* >> *at >> org.apache.ignite.internal.processors.cache.IgniteCacheOffheapManagerImpl.invoke(IgniteCacheOffheapManagerImpl.java:441)* >> *at >> org.apache.ignite.internal.processors.cache.GridCacheMapEntry.innerUpdate(GridCacheMapEntry.java:2327)* >> *at >> org.apache.ignite.internal.processors.cache.distributed.dht.atomic.GridDhtAtomicCache.updateSingle(GridDhtAtomicCache.java:2553)* >> *at >> org.apache.ignite.internal.processors.cache.distributed.dht.atomic.GridDhtAtomicCache.update(GridDhtAtomicCache.java:2016)* >> *at >> org.apache.ignite.internal.processors.cache.distributed.dht.atomic.GridDhtAtomicCache.updateAllAsyncInternal0(GridDhtAtomicCache.java:1833)* >> >> >> *Who knows why?Thanks!Hty,* >> *2022/04/02* >> >> >> >> >> >> > > > -- > С наилучшими пожеланиями, > Василий А. Лактионов > vasilylaktio...@gmail.com > > > > > -- С наилучшими пожеланиями, Василий А. Лактионов vasilylaktio...@gmail.com