Bug 1232282

Summary: (Consolidation) Infinispan-dsl-cache translator: Can't delete or update rows which were previously inserted through hotrod protocol
Product: [JBoss] JBoss Data Virtualization 6 Reporter: Filip Elias <felias>
Component: TeiidAssignee: Van Halbert <vhalbert>
Status: CLOSED CURRENTRELEASE QA Contact: Filip Elias <felias>
Severity: high Docs Contact: David Le Sage <dlesage>
Priority: unspecified    
Version: 6.2.0CC: atangrin, felias, hvan, vhalbert
Target Milestone: CR1Keywords: Documentation, QA-Closed
Target Release: 6.2.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-02-10 08:56:45 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1232182, 1232240, 1238357    
Bug Blocks:    
Attachments:
Description Flags
Unsuccessful delete statement
none
server1.log
none
server2.log none

Description Filip Elias 2015-06-16 12:27:27 UTC
Rows which have been inserted into cache directly through hotrod protocol can't be deleted or updated (update command returns correct number of rows to be updated but no rows are actually updated) using the Infinispan-dsl-cache translator.

If the rows are inserted through Infinispan-dsl-cache translator, then they can be deleted or updated.

Server1.log contains logs for an attempt to delete row which was previously directly inserted through hotrod protocol. It contains logs for two queries:
1, select * from smalla where intkey = 10 (returns 1 row)
2, delete from smalla where intkey = 10 (deletes 0 rows)

Server2.log contains logs for an attempt to delete row which was inserted using the Infinispan-dsl-cache translator. It contains logs for two queries:
1, insert into smalla(intKey, stringKey,booleanValue) values(141,'ss',false) (correctly inserts 1 row) 
2, delete from smalla where intkey = 10 (correctly deletes 1 row)

Comment 1 Filip Elias 2015-06-16 12:28:41 UTC
Created attachment 1039435 [details]
Unsuccessful delete statement

Comment 2 Filip Elias 2015-06-16 12:29:50 UTC
Created attachment 1039436 [details]
server1.log

Comment 3 Filip Elias 2015-06-16 12:30:14 UTC
Created attachment 1039437 [details]
server2.log

Comment 4 Filip Elias 2015-06-16 15:24:23 UTC
Sorry I mistyped the second set of queries. It should have been:

1, insert into smalla(intKey, stringKey,booleanValue) values(143,'ss',false) (correctly inserts 1 row) 
2, delete from smalla where intkey = 143 (correctly deletes 1 row)

Comment 7 Van Halbert 2015-06-26 18:54:18 UTC
I've been unable to determine the difference between QE's JDG install and mine that would incur this problem.  I have no issue deleting the objects that were inserted by the JDG quick start client that inserts thru Hot Rod Client.

More work needed.

Comment 8 Van Halbert 2015-06-29 22:20:31 UTC
Filip,

I realized that the JDG cache key is of type String, but the primary key that's defined in the Teiid model is of type Integer.  Those must match.   I noticed the documentation wasn't clear, so I've updated it upstream and will ask David to add the following to the documentation.

David, we need to add to the DSL translator the following note:

The data type for the primary key attribute in the class must match the JDG cache key data type.

Comment 9 Van Halbert 2015-06-30 17:39:46 UTC
Consolidating BZ: 1232240  under this blocker:

Infinispan-dsl-cache translator: NPE when inserting data if a table doesn't have primary key defined

Comment 10 Van Halbert 2015-07-02 20:55:24 UTC
Colidating BZ 1238357  under this blocker.

infinispan-cache-dsl - Exception: Sentence already started. Cannot use 'having(..)' again.

Comment 11 Van Halbert 2015-07-02 21:09:45 UTC
Consolidated BZ: 1232182 under this blocker.

Infinispan-dsl-cache translator: can't insert value into BYTE and BIGINTEGER columns

Comment 12 Van Halbert 2015-07-02 21:11:00 UTC
*** Bug 1232182 has been marked as a duplicate of this bug. ***

Comment 13 Van Halbert 2015-07-02 21:11:55 UTC
*** Bug 1232240 has been marked as a duplicate of this bug. ***

Comment 14 Van Halbert 2015-07-02 21:17:13 UTC
*** Bug 1238357 has been marked as a duplicate of this bug. ***

Comment 15 Van Halbert 2015-07-06 12:37:29 UTC
*** Bug 1232649 has been marked as a duplicate of this bug. ***

Comment 16 JBoss JIRA Server 2015-07-14 18:19:08 UTC
Steven Hawkins <shawkins> updated the status of jira TEIID-3536 to Resolved

Comment 17 Van Halbert 2015-07-16 17:59:30 UTC
Committed changes for :


- [1232182] Infinispan-dsl-cache translator: can't insert value into BYTE and BIGINTEGER columns

- [1238357] infinispan-cache-dsl - Exception: Sentence already started. Cannot use 'having(..)' again.

- [1232240] Infinispan-dsl-cache translator: NPE when inserting data if a table doesn't have primary key defined


Notes:

-  regarding Comment #8, and the data type for the primary key attribute in the class must match the JDG cache key data type.  This is no longer true. With the changes related to [1232182], the logic will now transform the value to the native type of the cache key type.  In order to know this, an enhancement to the connector-infinispan-dsl configuration was changed for the property CacheTypeMap to be in the format of:

cacheName:className[;pkFieldName[:cacheKeyJavaType]]

adding:  optional cacheKeyJavaType  

Example that was used with the BQT testing:  

smallARemotecache:org.jboss.qe.jdg_remote.pojo.SmallA;intKey:java.lang.String

Comment 18 Van Halbert 2015-07-16 17:59:40 UTC
Committed changes for :


- [1232182] Infinispan-dsl-cache translator: can't insert value into BYTE and BIGINTEGER columns

- [1238357] infinispan-cache-dsl - Exception: Sentence already started. Cannot use 'having(..)' again.

- [1232240] Infinispan-dsl-cache translator: NPE when inserting data if a table doesn't have primary key defined


Notes:

-  regarding Comment #8, and the data type for the primary key attribute in the class must match the JDG cache key data type.  This is no longer true. With the changes related to [1232182], the logic will now transform the value to the native type of the cache key type.  In order to know this, an enhancement to the connector-infinispan-dsl configuration was changed for the property CacheTypeMap to be in the format of:

cacheName:className[;pkFieldName[:cacheKeyJavaType]]

adding:  optional cacheKeyJavaType  

Example that was used with the BQT testing:  

smallARemotecache:org.jboss.qe.jdg_remote.pojo.SmallA;intKey:java.lang.String

Comment 19 Filip Elias 2015-08-18 11:51:07 UTC
Verified on DV 6.2 ER4

Comment 20 JBoss JIRA Server 2015-10-11 19:18:36 UTC
Steven Hawkins <shawkins> updated the status of jira TEIID-3536 to Closed