[jira] [Commented] (IGNITE-12021) Inserting date from Node.JS to a cache which has Java.SQL.Timestamp

2019-08-01 Thread Alexey Kosenchuk (JIRA)


[ 
https://issues.apache.org/jira/browse/IGNITE-12021?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16898203#comment-16898203
 ] 

Alexey Kosenchuk commented on IGNITE-12021:
---

please provide snippets of your code, where you send and receive data

> Inserting date from Node.JS to a cache which has Java.SQL.Timestamp
> ---
>
> Key: IGNITE-12021
> URL: https://issues.apache.org/jira/browse/IGNITE-12021
> Project: Ignite
>  Issue Type: Bug
>  Components: cache, thin client
>Affects Versions: 2.7
> Environment: We are in DEV right now. can't proceed to higher 
> environment with this show stopper
>Reporter: Gaurav
>Priority: Blocker
>  Labels: Node.JS, ignite,
>
> I have cache which has one field with type java.sql.Timestamp
>  
> From, Node.JS i am inserting it as new Date(). 
> If the cache is empty the inserts are successful. Issue come when java 
> inserted few records in this cache (Java inserts java.sql.Timestamp) . Now , 
> if I run Node.JS program which tries to insert it gives me this error.
>  
> Binary type has different field types [typeName=XYZCacheName, 
> fieldName=updateTime, fieldTypeName1=Timestamp, fieldTypeName2=Date]
>  
> Please help, its stopped my work totally!
>  
> P.S : JavaScript new Date() is itself a Timestamp, so cache should ideally 
> accept it as Timestamp and not Date.



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)


[jira] [Commented] (IGNITE-12021) Inserting date from Node.JS to a cache which has Java.SQL.Timestamp

2019-08-01 Thread Gaurav (JIRA)


[ 
https://issues.apache.org/jira/browse/IGNITE-12021?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16897953#comment-16897953
 ] 

Gaurav commented on IGNITE-12021:
-

Tried that. I didn't work. While doing this I got one more observation. 

I have used putAll and the data passes is array of cache entry. After inserting 
when I try to read using cache.Get() , I get Null.

 

If I insert using cache.put(new keyObj(), new valObj()) , I can read it from 
cache.Get()

 

What am I missing when inserting through cache entry???

 

Thanks,

Gaurav

> Inserting date from Node.JS to a cache which has Java.SQL.Timestamp
> ---
>
> Key: IGNITE-12021
> URL: https://issues.apache.org/jira/browse/IGNITE-12021
> Project: Ignite
>  Issue Type: Bug
>  Components: cache, thin client
>Affects Versions: 2.7
> Environment: We are in DEV right now. can't proceed to higher 
> environment with this show stopper
>Reporter: Gaurav
>Priority: Blocker
>  Labels: Node.JS, ignite,
>
> I have cache which has one field with type java.sql.Timestamp
>  
> From, Node.JS i am inserting it as new Date(). 
> If the cache is empty the inserts are successful. Issue come when java 
> inserted few records in this cache (Java inserts java.sql.Timestamp) . Now , 
> if I run Node.JS program which tries to insert it gives me this error.
>  
> Binary type has different field types [typeName=XYZCacheName, 
> fieldName=updateTime, fieldTypeName1=Timestamp, fieldTypeName2=Date]
>  
> Please help, its stopped my work totally!
>  
> P.S : JavaScript new Date() is itself a Timestamp, so cache should ideally 
> accept it as Timestamp and not Date.



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)


[jira] [Commented] (IGNITE-12021) Inserting date from Node.JS to a cache which has Java.SQL.Timestamp

2019-07-31 Thread Alexey Kosenchuk (JIRA)


[ 
https://issues.apache.org/jira/browse/IGNITE-12021?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16897293#comment-16897293
 ] 

Alexey Kosenchuk commented on IGNITE-12021:
---

mmm... maybe you need to specify the full java class name when creating your 
ComplexObjectType in NodeJs client. See the typeName parameter of the 
ComplexObjectType constructor.

But it's hard to help here w/o more details.

Please provide examples of your code (for NodeJs and for Java).

> Inserting date from Node.JS to a cache which has Java.SQL.Timestamp
> ---
>
> Key: IGNITE-12021
> URL: https://issues.apache.org/jira/browse/IGNITE-12021
> Project: Ignite
>  Issue Type: Bug
>  Components: cache, thin client
>Affects Versions: 2.7
> Environment: We are in DEV right now. can't proceed to higher 
> environment with this show stopper
>Reporter: Gaurav
>Priority: Blocker
>  Labels: Node.JS, ignite,
>
> I have cache which has one field with type java.sql.Timestamp
>  
> From, Node.JS i am inserting it as new Date(). 
> If the cache is empty the inserts are successful. Issue come when java 
> inserted few records in this cache (Java inserts java.sql.Timestamp) . Now , 
> if I run Node.JS program which tries to insert it gives me this error.
>  
> Binary type has different field types [typeName=XYZCacheName, 
> fieldName=updateTime, fieldTypeName1=Timestamp, fieldTypeName2=Date]
>  
> Please help, its stopped my work totally!
>  
> P.S : JavaScript new Date() is itself a Timestamp, so cache should ideally 
> accept it as Timestamp and not Date.



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)


[jira] [Commented] (IGNITE-12021) Inserting date from Node.JS to a cache which has Java.SQL.Timestamp

2019-07-31 Thread Gaurav (JIRA)


[ 
https://issues.apache.org/jira/browse/IGNITE-12021?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16897044#comment-16897044
 ] 

Gaurav commented on IGNITE-12021:
-

Thanks Alex, It worked like a charm.

 

Now, i ran into a different issue related Hash code.

 

How can I implement a hash code while inserting. The other side of application 
is in JAVA and they have custom logic of hash code.

Whenever I query the cache(Key is complex object) it gives me NULL.

When I insert from Node.JS, Java cannot read using cache.get()

Upon debugging I found its related to hash code.

 

Can you help on this topic.

 

Gaurav

> Inserting date from Node.JS to a cache which has Java.SQL.Timestamp
> ---
>
> Key: IGNITE-12021
> URL: https://issues.apache.org/jira/browse/IGNITE-12021
> Project: Ignite
>  Issue Type: Bug
>  Components: cache, thin client
>Affects Versions: 2.7
> Environment: We are in DEV right now. can't proceed to higher 
> environment with this show stopper
>Reporter: Gaurav
>Priority: Blocker
>  Labels: Node.JS, ignite,
>
> I have cache which has one field with type java.sql.Timestamp
>  
> From, Node.JS i am inserting it as new Date(). 
> If the cache is empty the inserts are successful. Issue come when java 
> inserted few records in this cache (Java inserts java.sql.Timestamp) . Now , 
> if I run Node.JS program which tries to insert it gives me this error.
>  
> Binary type has different field types [typeName=XYZCacheName, 
> fieldName=updateTime, fieldTypeName1=Timestamp, fieldTypeName2=Date]
>  
> Please help, its stopped my work totally!
>  
> P.S : JavaScript new Date() is itself a Timestamp, so cache should ideally 
> accept it as Timestamp and not Date.



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)


[jira] [Commented] (IGNITE-12021) Inserting date from Node.JS to a cache which has Java.SQL.Timestamp

2019-07-30 Thread Alexey Kosenchuk (JIRA)


[ 
https://issues.apache.org/jira/browse/IGNITE-12021?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16896583#comment-16896583
 ] 

Alexey Kosenchuk commented on IGNITE-12021:
---

Gaurav,

Probably, you do not specify the concrete Ignite type of your key/value/field.
In this case, the client uses the default mapping of types. NodeJs number is 
mapped to Ignite double by default.

Here is the explanation:
https://apacheignite.readme.io/docs/nodejs-thin-client-initialization-and-configuration#section-types-mapping-configuration
https://apacheignite.readme.io/docs/nodejs-thin-client-initialization-and-configuration#section-data-types

Tables with the default mapping you can find in the
ignite/modules/platforms/nodejs/lib/ObjectType.js file.

To specify a concrete Ignite type (instead of the default mapping) - see 
setKeyType() / setValueType() / setFieldType() methods.

> Inserting date from Node.JS to a cache which has Java.SQL.Timestamp
> ---
>
> Key: IGNITE-12021
> URL: https://issues.apache.org/jira/browse/IGNITE-12021
> Project: Ignite
>  Issue Type: Bug
>  Components: cache, thin client
>Affects Versions: 2.7
> Environment: We are in DEV right now. can't proceed to higher 
> environment with this show stopper
>Reporter: Gaurav
>Priority: Blocker
>  Labels: Node.JS, ignite,
>
> I have cache which has one field with type java.sql.Timestamp
>  
> From, Node.JS i am inserting it as new Date(). 
> If the cache is empty the inserts are successful. Issue come when java 
> inserted few records in this cache (Java inserts java.sql.Timestamp) . Now , 
> if I run Node.JS program which tries to insert it gives me this error.
>  
> Binary type has different field types [typeName=XYZCacheName, 
> fieldName=updateTime, fieldTypeName1=Timestamp, fieldTypeName2=Date]
>  
> Please help, its stopped my work totally!
>  
> P.S : JavaScript new Date() is itself a Timestamp, so cache should ideally 
> accept it as Timestamp and not Date.



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)


[jira] [Commented] (IGNITE-12021) Inserting date from Node.JS to a cache which has Java.SQL.Timestamp

2019-07-30 Thread Gaurav (JIRA)


[ 
https://issues.apache.org/jira/browse/IGNITE-12021?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16896035#comment-16896035
 ] 

Gaurav commented on IGNITE-12021:
-

Thanks Alex, it helped a lot.

 

Now, I am getting issues inserting numbers(Integer) from javascript to Ignite.

 

Ignite is treating as double. Not sure why? 

 

Could you please throw some pointers!

 

Thanks and appreciate your time.

 

Gaurav

> Inserting date from Node.JS to a cache which has Java.SQL.Timestamp
> ---
>
> Key: IGNITE-12021
> URL: https://issues.apache.org/jira/browse/IGNITE-12021
> Project: Ignite
>  Issue Type: Bug
>  Components: cache, thin client
>Affects Versions: 2.7
> Environment: We are in DEV right now. can't proceed to higher 
> environment with this show stopper
>Reporter: Gaurav
>Priority: Blocker
>  Labels: Node.JS, ignite,
>
> I have cache which has one field with type java.sql.Timestamp
>  
> From, Node.JS i am inserting it as new Date(). 
> If the cache is empty the inserts are successful. Issue come when java 
> inserted few records in this cache (Java inserts java.sql.Timestamp) . Now , 
> if I run Node.JS program which tries to insert it gives me this error.
>  
> Binary type has different field types [typeName=XYZCacheName, 
> fieldName=updateTime, fieldTypeName1=Timestamp, fieldTypeName2=Date]
>  
> Please help, its stopped my work totally!
>  
> P.S : JavaScript new Date() is itself a Timestamp, so cache should ideally 
> accept it as Timestamp and not Date.



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)


[jira] [Commented] (IGNITE-12021) Inserting date from Node.JS to a cache which has Java.SQL.Timestamp

2019-07-27 Thread Alexey Kosenchuk (JIRA)


[ 
https://issues.apache.org/jira/browse/IGNITE-12021?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16894376#comment-16894376
 ] 

Alexey Kosenchuk commented on IGNITE-12021:
---

const IgniteClient = require('apache-ignite-client');
const Timestamp = IgniteClient.Timestamp;

And then in your constructor
this.lastUpdateTime = new Timestamp(new Date().getTime(), 0);

 

> Inserting date from Node.JS to a cache which has Java.SQL.Timestamp
> ---
>
> Key: IGNITE-12021
> URL: https://issues.apache.org/jira/browse/IGNITE-12021
> Project: Ignite
>  Issue Type: Bug
>  Components: cache, thin client
>Affects Versions: 2.7
> Environment: We are in DEV right now. can't proceed to higher 
> environment with this show stopper
>Reporter: Gaurav
>Priority: Blocker
>  Labels: Node.JS, ignite,
>
> I have cache which has one field with type java.sql.Timestamp
>  
> From, Node.JS i am inserting it as new Date(). 
> If the cache is empty the inserts are successful. Issue come when java 
> inserted few records in this cache (Java inserts java.sql.Timestamp) . Now , 
> if I run Node.JS program which tries to insert it gives me this error.
>  
> Binary type has different field types [typeName=XYZCacheName, 
> fieldName=updateTime, fieldTypeName1=Timestamp, fieldTypeName2=Date]
>  
> Please help, its stopped my work totally!
>  
> P.S : JavaScript new Date() is itself a Timestamp, so cache should ideally 
> accept it as Timestamp and not Date.



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)


[jira] [Commented] (IGNITE-12021) Inserting date from Node.JS to a cache which has Java.SQL.Timestamp

2019-07-26 Thread Gaurav (JIRA)


[ 
https://issues.apache.org/jira/browse/IGNITE-12021?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16894280#comment-16894280
 ] 

Gaurav commented on IGNITE-12021:
-

Here the sample class which I put as value in the cache.

Class order{

Constructor (id, name, qty, lastUpdateTime)
{

 this.id=id;
this.name=name;
this.qty=qty;
this.lastUpdateTime= new Date();
}

}


Last Update Time is java.sql.Timestamp in Cache config .

Please suggest the change to send Timestamp.

Thanks ,
Gaurav



> Inserting date from Node.JS to a cache which has Java.SQL.Timestamp
> ---
>
> Key: IGNITE-12021
> URL: https://issues.apache.org/jira/browse/IGNITE-12021
> Project: Ignite
>  Issue Type: Bug
>  Components: cache, thin client
>Affects Versions: 2.7
> Environment: We are in DEV right now. can't proceed to higher 
> environment with this show stopper
>Reporter: Gaurav
>Priority: Blocker
>  Labels: Node.JS, ignite,
>
> I have cache which has one field with type java.sql.Timestamp
>  
> From, Node.JS i am inserting it as new Date(). 
> If the cache is empty the inserts are successful. Issue come when java 
> inserted few records in this cache (Java inserts java.sql.Timestamp) . Now , 
> if I run Node.JS program which tries to insert it gives me this error.
>  
> Binary type has different field types [typeName=XYZCacheName, 
> fieldName=updateTime, fieldTypeName1=Timestamp, fieldTypeName2=Date]
>  
> Please help, its stopped my work totally!
>  
> P.S : JavaScript new Date() is itself a Timestamp, so cache should ideally 
> accept it as Timestamp and not Date.



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)


[jira] [Commented] (IGNITE-12021) Inserting date from Node.JS to a cache which has Java.SQL.Timestamp

2019-07-26 Thread Alexey Kosenchuk (JIRA)


[ 
https://issues.apache.org/jira/browse/IGNITE-12021?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16894141#comment-16894141
 ] 

Alexey Kosenchuk commented on IGNITE-12021:
---

[~g21wadhwa] could please provide a snippet of your nodejs code where you work 
with Date/Timestamp.

The current nodejs client does not allow to write Date as Timestamp.

> Inserting date from Node.JS to a cache which has Java.SQL.Timestamp
> ---
>
> Key: IGNITE-12021
> URL: https://issues.apache.org/jira/browse/IGNITE-12021
> Project: Ignite
>  Issue Type: Bug
>  Components: cache, thin client
>Affects Versions: 2.7
> Environment: We are in DEV right now. can't proceed to higher 
> environment with this show stopper
>Reporter: Gaurav
>Priority: Blocker
>  Labels: Node.JS, ignite,
>
> I have cache which has one field with type java.sql.Timestamp
>  
> From, Node.JS i am inserting it as new Date(). 
> If the cache is empty the inserts are successful. Issue come when java 
> inserted few records in this cache (Java inserts java.sql.Timestamp) . Now , 
> if I run Node.JS program which tries to insert it gives me this error.
>  
> Binary type has different field types [typeName=XYZCacheName, 
> fieldName=updateTime, fieldTypeName1=Timestamp, fieldTypeName2=Date]
>  
> Please help, its stopped my work totally!
>  
> P.S : JavaScript new Date() is itself a Timestamp, so cache should ideally 
> accept it as Timestamp and not Date.



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)