ignite-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Isaksen <thomas.isak...@sysco.no>
Subject RE: Binary type has different affinity key fields
Date Fri, 26 Jan 2018 09:27:10 GMT
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:

	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,

Next I try to put one entry into my cache:
Public void testIgnite()
	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

INSERT INTO UserCache (id,username,password) VALUES (1, 'foo','bar');

Thomas Isaksen

-----Original Message-----
From: slava.koptilin [mailto:slava.koptilin@gmail.com] 
Sent: torsdag 25. januar 2018 17.39
To: user@ignite.apache.org
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
I mean definition CredentialsKey and Credentials and code that can be used in order to reproduce
the exception you mentioned.

Best regards,

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

View raw message