You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by minisoft_rm <mi...@hotmail.com> on 2017/01/25 12:21:29 UTC

insert/update/delete issue in Version 1.8

dear experts:
I got exception - "Caused by: java.lang.IllegalStateException: Ownership
flag not set for binary property. Have you set 'keyFields' property of
QueryEntity in programmatic or XML configuration?
"

when my code is following link of
"https://apacheignite.readme.io/docs/jdbc-driver".

part of my code like below"
...........
Class.forName("org.apache.ignite.IgniteJdbcDriver");
this.conn =
DriverManager.getConnection("jdbc:ignite:cfg://cache=CartentriesCache@file:///Users/i306576/hybris.xxx/hybris.6200.ignite18/hybris/bin/custom/ucs/resources/ignite-jdbc.xml");
			
final PreparedStatement stmt =getConn().prepareStatement("update cartentries
set  p_quantity=21 where pk=8796093054977");
stmt.executeUpdate();
"


I feel I followed the instructions... but why not successful? please advise.



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/insert-update-delete-issue-in-Version-1-8-tp10244.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: insert/update/delete issue in Version 1.8

Posted by Andrey Novikov <an...@apache.org>.
Denis,

Ticket https://issues.apache.org/jira/browse/IGNITE-4622 was fixed in master
branch.



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/insert-update-delete-issue-in-Version-1-8-tp10244p10280.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: insert/update/delete issue in Version 1.8

Posted by Denis Magda <dm...@apache.org>.
Please see below 

> On Jan 26, 2017, at 8:56 AM, minisoft_rm <mi...@hotmail.com> wrote:
> 
> Hi Denis, thank you. it works.
> 
> I manually... added these line... something like "
> 
> Set<String> keyFlds = new HashSet<>();
> keyFlds.add("pk");
> qryEntity.setKeyFields(keyFlds);
> 
> "
> 
> after that , no more exception there. I am wondering... so I reviewed the
> "model" section of web console. it generates everything for us, right? and I
> found it is a little strange...  
> 
> in WEB CONSOLE:
>     the auto generated code is "
>     qryEntity.setKeyFields(new JdbcTypeField(Types.BIGINT, "PK",
> long.class, "pk"));
> "
> in DOWNLOADED zip file, code is "
>     type.setKeyFields(new JdbcTypeField(Types.BIGINT, "PK", long.class,
> "pk"));
> " the type is "JdbcType"... not the "qryEntity"
> 
> so is it a minor bug?
> 
> 
Yes, this is a bug. Thanks for reporting. The ticket is ready:
https://issues.apache.org/jira/browse/IGNITE-4622 <https://issues.apache.org/jira/browse/IGNITE-4622>

Andrey N, Alex K, please take a look at it.

> 
> after that, May I ask one more question.... the update sql returns no more
> exception, it is good. But, the data doesn't be udpated....in ignite and
> Db... do you have any comments? thanks :-)
> 
> 

This sounds weird and unbelievable :) Please share the code snippet that does the update and that validates that the data has been updated.

—
Denis

> 
> 
> --
> View this message in context: http://apache-ignite-users.70518.x6.nabble.com/insert-update-delete-issue-in-Version-1-8-tp10244p10260.html
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.


Re: insert/update/delete issue in Version 1.8

Posted by minisoft_rm <mi...@hotmail.com>.
Hi Denis, thank you. it works.

I manually... added these line... something like "

Set<String> keyFlds = new HashSet<>();
keyFlds.add("pk");
qryEntity.setKeyFields(keyFlds);

"

after that , no more exception there. I am wondering... so I reviewed the
"model" section of web console. it generates everything for us, right? and I
found it is a little strange...  

in WEB CONSOLE:
     the auto generated code is "
     qryEntity.setKeyFields(new JdbcTypeField(Types.BIGINT, "PK",
long.class, "pk"));
"
in DOWNLOADED zip file, code is "
     type.setKeyFields(new JdbcTypeField(Types.BIGINT, "PK", long.class,
"pk"));
" the type is "JdbcType"... not the "qryEntity"

so is it a minor bug?



after that, May I ask one more question.... the update sql returns no more
exception, it is good. But, the data doesn't be udpated....in ignite and
Db... do you have any comments? thanks :-)




--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/insert-update-delete-issue-in-Version-1-8-tp10244p10260.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: insert/update/delete issue in Version 1.8

Posted by Denis Magda <dm...@apache.org>.
Please double check this documentation section
https://apacheignite.readme.io/docs/dml#advanced-configuration <https://apacheignite.readme.io/docs/dml#advanced-configuration>

If you have your custom key with multiple fields then key’s fields must be separated from value’s fields at the configuration level. The documentation section provides examples for this.

—
Denis

> On Jan 25, 2017, at 4:21 AM, minisoft_rm <mi...@hotmail.com> wrote:
> 
> dear experts:
> I got exception - "Caused by: java.lang.IllegalStateException: Ownership
> flag not set for binary property. Have you set 'keyFields' property of
> QueryEntity in programmatic or XML configuration?
> "
> 
> when my code is following link of
> "https://apacheignite.readme.io/docs/jdbc-driver".
> 
> part of my code like below"
> ...........
> Class.forName("org.apache.ignite.IgniteJdbcDriver");
> this.conn =
> DriverManager.getConnection("jdbc:ignite:cfg://cache=CartentriesCache@file:///Users/i306576/hybris.xxx/hybris.6200.ignite18/hybris/bin/custom/ucs/resources/ignite-jdbc.xml");
> 			
> final PreparedStatement stmt =getConn().prepareStatement("update cartentries
> set  p_quantity=21 where pk=8796093054977");
> stmt.executeUpdate();
> "
> 
> 
> I feel I followed the instructions... but why not successful? please advise.
> 
> 
> 
> --
> View this message in context: http://apache-ignite-users.70518.x6.nabble.com/insert-update-delete-issue-in-Version-1-8-tp10244.html
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.


Re: insert/update/delete issue in Version 1.8

Posted by Alexander Paschenko <al...@gmail.com>.
Hi,

Please show your configuration file (at least the section with
QueryEntities) or how you configure your cache programmatically.

- Alex

2017-01-25 15:21 GMT+03:00 minisoft_rm <mi...@hotmail.com>:
> dear experts:
> I got exception - "Caused by: java.lang.IllegalStateException: Ownership
> flag not set for binary property. Have you set 'keyFields' property of
> QueryEntity in programmatic or XML configuration?
> "
>
> when my code is following link of
> "https://apacheignite.readme.io/docs/jdbc-driver".
>
> part of my code like below"
> ...........
> Class.forName("org.apache.ignite.IgniteJdbcDriver");
> this.conn =
> DriverManager.getConnection("jdbc:ignite:cfg://cache=CartentriesCache@file:///Users/i306576/hybris.xxx/hybris.6200.ignite18/hybris/bin/custom/ucs/resources/ignite-jdbc.xml");
>
> final PreparedStatement stmt =getConn().prepareStatement("update cartentries
> set  p_quantity=21 where pk=8796093054977");
> stmt.executeUpdate();
> "
>
>
> I feel I followed the instructions... but why not successful? please advise.
>
>
>
> --
> View this message in context: http://apache-ignite-users.70518.x6.nabble.com/insert-update-delete-issue-in-Version-1-8-tp10244.html
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.