Re: Why portable marshaller handle Date and Timestamp in the same way?

2015-10-06 Thread Denis Magda
I would definitely remove such a mapping if no one explains a reason we have it. -- Denis On 10/6/2015 10:26 AM, Vladimir Ozerov wrote: Igniters, For some reason we "merged" Date and Timestamp types in portable marshaller. They are both written in the same format with the same type ID. And

Re: Why portable marshaller handle Date and Timestamp in the same way?

2015-10-06 Thread Pavel Tupitsyn
Keep in mind that separating them can introduce difficulties for other platforms. For example, DateTime in .Net has more precision (100ns vs 1ms in Java). Serializing this in Java format will lead to data loss. Serializing .Net DateTime as Timestamp will preserve precision, but may hurt

Re: Why portable marshaller handle Date and Timestamp in the same way?

2015-10-06 Thread Dmitriy Setrakyan
On Tue, Oct 6, 2015 at 2:42 AM, Vladimir Ozerov wrote: > This doesn't answers the question. First, Java Timestamp has greater > precision than .Net DateTime, so silent data loss could happen in this case > as well. Second, "use timestamp" is defined on class level. It means

Re: Why portable marshaller handle Date and Timestamp in the same way?

2015-10-06 Thread Vladimir Ozerov
Yakov, this could work in .Net where you have real generics. But it will not work in Java in general case due to type erasure - you simply cannot infer the type. Let's look closely to this: Date Java: 10^-3 Timestamp Java: 10^-9 DateTime .Net: 10^-7 What we see here, is that mapping Java

Re: Why portable marshaller handle Date and Timestamp in the same way?

2015-10-06 Thread Branko Čibej
On 06.10.2015 12:26, Vladimir Ozerov wrote: > Yakov, this could work in .Net where you have real generics. But it will > not work in Java in general case due to type erasure - you simply cannot > infer the type. > > Let's look closely to this: > Date Java: 10^-3 > Timestamp Java: 10^-9 >