I seem to have run into a problem with POF serialization of dates. For some reason the C++ deserialization of dates checks the date to see if it's valid. This seems beyond the bounds of a serializer, however performance aside the POF rawDateTime thinks that the year 1/1/3000 is an invalid date. We have some fields with dates far in the future, I know the database, java, and our c++ can handle these dates.
The second approach is to serialize the date to a long, however the date can be null. So how do I represent a null date? Maybe I could use 0 or -1, however this introduces a compare for every date we serialize, something which I want to avoid.
Is there a way of telling the c++ coherence POF serializer that this date is not out of range?
Thanks for the reply.
I'm using 3.6, so it's weird that there's a 3.5 patch, yet the problem persists in 3.6?
String is a nice idea, but I don't want to incur the performance penalty of turning the date into a string and back.
Is there a similar patch for 3.6?
P.S Sorry for the multiple posts, the web site kept saying there was an error each time I posted.
This issue was identified after 3.6.0 had shipped. While the fix has been made to both the Coherence 3.5 and 3.6 codelines, only the 3.5 version has been made publicly available as a patch. Based on the comments in the issue number, it looks like the 3.6 fix is slated to be part of the upcoming 3.6 SP1 (3.6.1). As for interim work arounds the only thing I can suggest is to encode the value as using the Coherence C++ Integer64 object (equivalent of java.lang.Long), this will allow you to both have a NULL value, as well as a way to encode any date you choose.