Hi Slava Thanks for pointing out my mistakes with the template. I have attached the java classes in question and the ignite config file that I am using .
I create the table using DDL as follows:
CREATE TABLE UserCache (
id bigint,
username varchar,
password varchar,
PRIMARY KEY (username, password)
)
WITH "template=userCache, affinitykey=username, cache_name=UserCache,
key_type=no.toyota.gatekeeper.ignite.key.CredentialsKey,
value_type=no.toyota.gatekeeper.authenticate.Credentials";
Next I try to put one entry into my cache:
@Test
Public void testIgnite()
{
Ignition.setClientMode(true);
Ignite ignite = Ignition.start("/config/test-config.xml");
IgniteCache<CredentialsKey, Credentials> cache =
ignite.cache("UserCache");
// this blows up
cache.put(new CredentialsKey("foo","bar"), new
Credentials("foo","bar","resourceId"));
}
I am not sure my code is correct but I get the same error when I try to insert
a row using SQL.
INSERT INTO UserCache (id,username,password) VALUES (1, 'foo','bar');
--
Thomas Isaksen
-----Original Message-----
From: slava.koptilin [mailto:[email protected]]
Sent: torsdag 25. januar 2018 17.39
To: [email protected]
Subject: RE: Binary type has different affinity key fields
Hi Thomas,
CREATE TABLE statement doesn't use your template because you specified the
predefined one - 'partitioned' *template=partitioned*
In case of using replicated mode, the following property <property
name="backups" value="1"/> does not make sense.
Could you please share full reproducer? I will try it on my side and come back
to you with findings.
I mean definition CredentialsKey and Credentials and code that can be used in
order to reproduce the exception you mentioned.
Best regards,
Slava.
--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
CredentialsKey.java
Description: CredentialsKey.java
Credentials.java
Description: Credentials.java
test-config.xml
Description: test-config.xml
