You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by siva <si...@bizruntime.com> on 2020/01/13 16:23:19 UTC

WriteAll() method on insert statement execute from sqlline

Hi,
I am using .net core Application for Ignite client and server,Ignite V2.7.6.

Table and indexes created through QueryEntity from Model class.

So same table i am using with 3rd party thin client to put data into cache.

e.g:
----
public interface ICustomCacheStore
    {
    }

public class Person:ICustomCacheStore{
	[QuerySqlField]
	public String Id { get; set; }
	[QuerySqlField]
	public String Name { get; set; }
	...
}

var personObject = new Person(){
Id=123,
Name=Ram
};

cache.putAsync("Person",personObject);

On putAsync writeAll through write behind enable calling
here is the writeAll() method implementation.

 public void WriteAll(IEnumerable<KeyValuePair&lt;string,
ICustomCacheStore>> entries){
 //parse incoming entries and insert into sql server code
 ....
 ...
 //successfully insertion happening
 }
 
but some other table created through create command.
e.g:
CREATE TABLE IF NOT EXISTS
"C091E548-B45A-49B4-B8EC-2CB5E27C7AF6".EntitiesPulsarTest(EntityId
varchar,EntityType varchar,EntityInfoJson varchar,TenantName
varchar,TenantId varchar,Fabric varchar,EntityName varchar,SequenceNumber
Double) WITH "template=partitioned,backups=0";

 
but on insert statement execute from sqlline inside WriteAll() method
getting the following exception:
public void WriteAll(IEnumerable<KeyValuePair&lt;string, ICustomCacheStore>>
entries)
        {
		List<KeyValuePair&lt;string, ICustomCacheStore>> entityList =
entries.ToList();//here getting an exception
		foreach (var recordEntry in entityList)
                {
				...
				...
				...
				}
		}

Unknown pair [platformId=1, typeId=1505474372]

class org.apache.ignite.binary.BinaryObjectException: Unknown pair
[platformId=1, typeId=1505474372]
	at
org.apache.ignite.internal.processors.platform.binary.PlatformBinaryProcessor.processInStreamOutStream(PlatformBinaryProcessor.java:126)
	at
org.apache.ignite.internal.processors.platform.PlatformTargetProxyImpl.inStreamOutStream(PlatformTargetProxyImpl.java:136)
	at
org.apache.ignite.internal.processors.platform.callback.PlatformCallbackUtils.inLongOutLong(Native
Method)
	at
org.apache.ignite.internal.processors.platform.callback.PlatformCallbackGateway.cacheStoreInvoke(PlatformCallbackGateway.java:80)
	at
org.apache.ignite.internal.processors.platform.dotnet.PlatformDotNetCacheStore.doInvoke(PlatformDotNetCacheStore.java:480)
	at
org.apache.ignite.internal.processors.platform.dotnet.PlatformDotNetCacheStore.writeAll(PlatformDotNetCacheStore.java:277)
	at
org.apache.ignite.internal.processors.cache.store.GridCacheWriteBehindStore.updateStore(GridCacheWriteBehindStore.java:816)
	at
org.apache.ignite.internal.processors.cache.store.GridCacheWriteBehindStore.applyBatch(GridCacheWriteBehindStore.java:726)
	at
org.apache.ignite.internal.processors.cache.store.GridCacheWriteBehindStore.access$2400(GridCacheWriteBehindStore.java:76)
	at
org.apache.ignite.internal.processors.cache.store.GridCacheWriteBehindStore$Flusher.flushCacheCoalescing(GridCacheWriteBehindStore.java:1147)
	at
org.apache.ignite.internal.processors.cache.store.GridCacheWriteBehindStore$Flusher.body(GridCacheWriteBehindStore.java:1018)
	at
org.apache.ignite.internal.util.worker.GridWorker.run(GridWorker.java:120)
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.ClassNotFoundException: Unknown pair [platformId=1,
typeId=1505474372]
	at
org.apache.ignite.internal.MarshallerContextImpl.getClassName(MarshallerContextImpl.java:394)
	at
org.apache.ignite.internal.processors.platform.binary.PlatformBinaryProcessor.processInStreamOutStream(PlatformBinaryProcessor.java:121)
	... 12 more
	
	
So how to receive as key value pair result as same working like putAsync
cache.

Receive WriteAll(IEnumerable<KeyValuePair&lt;string, ICustomCacheStore>>
entries) method acceptable format data where table created through query, on
insert statement execute from sqlline?




--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: WriteAll() method on insert statement execute from sqlline

Posted by Pavel Tupitsyn <pt...@apache.org>.
When you insert data from C# code, Ignite registers Person class
automatically
and knows how to deserialize it later.

But when you insert data from Sqline, Ignite.NET does not know about Person
class yet,
so deserialization fails.

You can fix this by setting
IgniteConfiguration.BinaryConfiguration = new
BinaryConfiguration(typeof(Person)).

Or, after Ignite has been started:
ignite.GetBinary().GetBinaryType(typeof(Person))

On Mon, Jan 13, 2020 at 7:23 PM siva <si...@bizruntime.com> wrote:

>
> Hi,
> I am using .net core Application for Ignite client and server,Ignite
> V2.7.6.
>
> Table and indexes created through QueryEntity from Model class.
>
> So same table i am using with 3rd party thin client to put data into cache.
>
> e.g:
> ----
> public interface ICustomCacheStore
>     {
>     }
>
> public class Person:ICustomCacheStore{
>         [QuerySqlField]
>         public String Id { get; set; }
>         [QuerySqlField]
>         public String Name { get; set; }
>         ...
> }
>
> var personObject = new Person(){
> Id=123,
> Name=Ram
> };
>
> cache.putAsync("Person",personObject);
>
> On putAsync writeAll through write behind enable calling
> here is the writeAll() method implementation.
>
>  public void WriteAll(IEnumerable<KeyValuePair&lt;string,
> ICustomCacheStore>> entries){
>  //parse incoming entries and insert into sql server code
>  ....
>  ...
>  //successfully insertion happening
>  }
>
> but some other table created through create command.
> e.g:
> CREATE TABLE IF NOT EXISTS
> "C091E548-B45A-49B4-B8EC-2CB5E27C7AF6".EntitiesPulsarTest(EntityId
> varchar,EntityType varchar,EntityInfoJson varchar,TenantName
> varchar,TenantId varchar,Fabric varchar,EntityName varchar,SequenceNumber
> Double) WITH "template=partitioned,backups=0";
>
>
> but on insert statement execute from sqlline inside WriteAll() method
> getting the following exception:
> public void WriteAll(IEnumerable<KeyValuePair&lt;string,
> ICustomCacheStore>>
> entries)
>         {
>                 List<KeyValuePair&lt;string, ICustomCacheStore>>
> entityList =
> entries.ToList();//here getting an exception
>                 foreach (var recordEntry in entityList)
>                 {
>                                 ...
>                                 ...
>                                 ...
>                                 }
>                 }
>
> Unknown pair [platformId=1, typeId=1505474372]
>
> class org.apache.ignite.binary.BinaryObjectException: Unknown pair
> [platformId=1, typeId=1505474372]
>         at
>
> org.apache.ignite.internal.processors.platform.binary.PlatformBinaryProcessor.processInStreamOutStream(PlatformBinaryProcessor.java:126)
>         at
>
> org.apache.ignite.internal.processors.platform.PlatformTargetProxyImpl.inStreamOutStream(PlatformTargetProxyImpl.java:136)
>         at
>
> org.apache.ignite.internal.processors.platform.callback.PlatformCallbackUtils.inLongOutLong(Native
> Method)
>         at
>
> org.apache.ignite.internal.processors.platform.callback.PlatformCallbackGateway.cacheStoreInvoke(PlatformCallbackGateway.java:80)
>         at
>
> org.apache.ignite.internal.processors.platform.dotnet.PlatformDotNetCacheStore.doInvoke(PlatformDotNetCacheStore.java:480)
>         at
>
> org.apache.ignite.internal.processors.platform.dotnet.PlatformDotNetCacheStore.writeAll(PlatformDotNetCacheStore.java:277)
>         at
>
> org.apache.ignite.internal.processors.cache.store.GridCacheWriteBehindStore.updateStore(GridCacheWriteBehindStore.java:816)
>         at
>
> org.apache.ignite.internal.processors.cache.store.GridCacheWriteBehindStore.applyBatch(GridCacheWriteBehindStore.java:726)
>         at
>
> org.apache.ignite.internal.processors.cache.store.GridCacheWriteBehindStore.access$2400(GridCacheWriteBehindStore.java:76)
>         at
>
> org.apache.ignite.internal.processors.cache.store.GridCacheWriteBehindStore$Flusher.flushCacheCoalescing(GridCacheWriteBehindStore.java:1147)
>         at
>
> org.apache.ignite.internal.processors.cache.store.GridCacheWriteBehindStore$Flusher.body(GridCacheWriteBehindStore.java:1018)
>         at
> org.apache.ignite.internal.util.worker.GridWorker.run(GridWorker.java:120)
>         at java.lang.Thread.run(Thread.java:748)
> Caused by: java.lang.ClassNotFoundException: Unknown pair [platformId=1,
> typeId=1505474372]
>         at
>
> org.apache.ignite.internal.MarshallerContextImpl.getClassName(MarshallerContextImpl.java:394)
>         at
>
> org.apache.ignite.internal.processors.platform.binary.PlatformBinaryProcessor.processInStreamOutStream(PlatformBinaryProcessor.java:121)
>         ... 12 more
>
>
> So how to receive as key value pair result as same working like putAsync
> cache.
>
> Receive WriteAll(IEnumerable<KeyValuePair&lt;string, ICustomCacheStore>>
> entries) method acceptable format data where table created through query,
> on
> insert statement execute from sqlline?
>
>
>
>
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>