You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by Som Som <2a...@gmail.com> on 2018/08/17 13:28:52 UTC
I’v got an ignite java server node and a client node which is c#
application
public partial class TestEntityKey
{
public string s1 { get; set; }
public string s2 { get; set; }
}
public partial class TestEntity
{
public string v1 { get; set; }
public string v2 { get; set; }
}
static void Main(string[] args)
{
var ignite = Ignition.StartFromApplicationConfiguration();
var qe = new QueryEntity
{
KeyType = typeof(TestEntityKey),
ValueType = typeof(TestEntity),
Fields = new[]
{
new QueryField {Name = "s1", FieldType =
typeof(string) IsKeyField = true},
new QueryField {Name = "s2", FieldType =
typeof(string) IsKeyField = true },
new QueryField {Name = "v1", FieldType =
typeof(string) },
new QueryField {Name = "v2", FieldType =
typeof(string) },
}
};
var testCache = ignite.GetOrCreateCache<TestEntityKey,
TestEntity>
(
new CacheConfiguration
{
Name = "TestEntity",
QueryEntities = new[]
{
qe
},
SqlSchema = "PUBLIC"
}
);
Console.WriteLine("Press any key...");
Console.ReadKey();
ignite.Dispose();
}
I started client application then added one row into TestEntity table via
DBeaver, there was no problem on that point. Than I added one line of code
into my client application
*Console**.WriteLine(**$"\n**{ToString(testCache.FirstOrDefault())}**\n"*
*);”*
and got an error: “Requesting mapping from grid failed for [platformId=1,
typeId=-232515692]” after that I added one more line just before the first
one
testCache.Put(new TestEntityKey(), newTestEntity());
and after that I saw two rows of my TestEntity table without anybproblems.
Isn’t it an error?
Re:
Posted by Ilya Kasnacheev <il...@gmail.com>.
Hello!
Please try notifying Ignite about your types so that you can use them
immediately (without putting to cache first):
ignite.GetBinary().GetBinaryType(typeof(TestEntityKey));
ignite.GetBinary().GetBinaryType(typeof(TestEntity));
that before your Console.WriteLine() line.
Regards,
--
Ilya Kasnacheev
2018-08-17 16:28 GMT+03:00 Som Som <2a...@gmail.com>:
> I’v got an ignite java server node and a client node which is c#
> application
>
> public partial class TestEntityKey
>
> {
>
> public string s1 { get; set; }
>
> public string s2 { get; set; }
>
> }
>
>
>
> public partial class TestEntity
>
> {
>
> public string v1 { get; set; }
>
> public string v2 { get; set; }
>
> }
>
>
>
> static void Main(string[] args)
>
> {
>
> var ignite = Ignition.StartFromApplicationConfiguration();
>
>
>
> var qe = new QueryEntity
>
> {
>
> KeyType = typeof(TestEntityKey),
>
> ValueType = typeof(TestEntity),
>
> Fields = new[]
>
> {
>
> new QueryField {Name = "s1", FieldType =
> typeof(string) IsKeyField = true},
>
> new QueryField {Name = "s2", FieldType =
> typeof(string) IsKeyField = true },
>
> new QueryField {Name = "v1", FieldType =
> typeof(string) },
>
> new QueryField {Name = "v2", FieldType =
> typeof(string) },
>
> }
>
> };
>
>
>
> var testCache = ignite.GetOrCreateCache<TestEntityKey,
> TestEntity>
>
> (
>
> new CacheConfiguration
>
> {
>
> Name = "TestEntity",
>
> QueryEntities = new[]
>
> {
>
> qe
>
> },
>
> SqlSchema = "PUBLIC"
>
> }
>
> );
>
> Console.WriteLine("Press any key...");
>
> Console.ReadKey();
>
>
>
> ignite.Dispose();
>
> }
>
> I started client application then added one row into TestEntity table via
> DBeaver, there was no problem on that point. Than I added one line of code
> into my client application
>
> *Console**.WriteLine(**$"\n**{ToString(testCache.FirstOrDefault())}**\n"*
> *);”*
>
> and got an error: “Requesting mapping from grid failed for [platformId=1,
> typeId=-232515692]” after that I added one more line just before the first
> one
>
> testCache.Put(new TestEntityKey(), newTestEntity());
>
> and after that I saw two rows of my TestEntity table without anybproblems.
>
> Isn’t it an error?
>