ignite-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Valentin Kulichenko <valentin.kuliche...@gmail.com>
Subject Re: Error in JDBC store
Date Thu, 29 Dec 2016 20:07:29 GMT
Hi Dmitry,

My opinion is that this is not a valid case and we should throw an
exception on cache startup if two Java fields are mapped to the same DB
field. Even if user needs such duplication on objects level (which I also
doubt, BTW), the mapping in the store must be correct.

-Val

On Thu, Dec 29, 2016 at 12:23 AM, Dmitriy Karachentsev <
dkarachentsev@gridgain.com> wrote:

> Hi all!
>
> According to this thread [1] in JDBC store configuration:
> 1. Map key and value fields to the same columns in DB.
> 2. Try to update data.
> 3. Got invalid SQL.
>
> Let's see an pseudocode example of described use case.
> KeyClass { field1; field2; field3 }, ValClass { field1; field2; field3 }
>
> Map fields to DB table TABLE_NAME columns: field1 -> col1, field2 -> col2,
> field3 -> col3.
>
> User expects the following update request built by Ignite:
> UPDATE TABLE_NAME SET col1=?, col2=?, col3=? WHERE (col1=?, col2=?,
> col3=?);
>
> But Ignite checks that value object fields have the same mappings, throws
> them away and builds wrong query:
> UPDATE TABLE_NAME SET WHERE (col1=?, col2=?, col3=?);
> That is obviously wrong.
>
> Is there any reason to do so?
> Probably, it is better to build query according to user mapping and
> delegate verification to DB.
>
> [1]
> http://apache-ignite-users.70518.x6.nabble.com/Error-
> while-writethrough-operation-in-Ignite-td9696.html
>
> Thanks!
> Dmitry.
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message