Sorry for the delay in getting back to - was pulled in another direction for
a while.
Of course I am not using ValueTimestamp directly, was just trying to cut to
the chase, but clearly did not give you enough context to work with.
Here is the problem I am currently encountering, and a very simple way to
reproduce:
1. Create a table with a timestamp column which has a unique constraint.
2. Running in PST/PDT (or probably anywhere west of GMT), attempt to insert
the following dates using utc calendar (ps.setTimestamp(new
Timestamp(d.getTime(), utcCalendar):
// assume dates properly created in PST
"2010-03-13 18:15 PST"
"2010-03-13 19:15 PST"
The first date inserts correctly, the second date throws a unique
constraint exception.
You may notice these dates are not actually crossing a DST boundary yet.
This is what initially confused me when digging through the source code.
Because the timestamps are being modified under the covers, the problem
happens at an unexpected time (my first unit tests passed when they should
have failed because I covered exactly the DST boundary instead of 8 hours
before... very confusing!)
The exception appears to be a result of ValueTimestamp.compareSecure,
however I do not have the source code correctly linked so I am unable to
introspect the actual values. I did notice that at some point during the
compare process DateTimeUtils.dateValueFromDate(long ms) is being called,
which is ultimately returning:
return ((long) year << SHIFT_YEAR) | (month << SHIFT_MONTH) | day;
This doesn't look right to me (where are the hours/minutes/seconds/millis?),
but honestly at this point my head is swimming from all the layers.
Any help on this would be greatly appreciated. I have a massive test
framework built on top of this which will only be useful if I can solve this
issue.
Thanks in advance for your time!
Jamie
--
You received this message because you are subscribed to the Google Groups "H2
Database" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/h2-database?hl=en.