Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community Forumscreating history records - potential clock issues
https://www.eclipse.org/forums/index.php/mv/msg/158432/500236/#msg_500236
My applications are Swing fat clients. Because the values are literal values derived from the client's clock, issues with differences in the clocks on the clients maybe garble the data. Suppose one client has a clock that differs a few seconds from another client's (not uncommon). That may cause the start-end time to not be in sequence, or even worse: duplicate values (I set the timestamp to milliseconds to try and prevent that last one).
Naturally clock sync will cure this somewhat, but it's an external solution to what could also be solved internally by using the clock of the database instead of the client; by not providing literal values, but database variables. So instead of "2009-11-25 13:59:00.000" provide (in my case of using Informix's datetime) "current year to fraction".
Since using database variables is depending on the field type, default behavior should still be literal values, but configurable to use database variables.
Tom]]>Tom Eugelink2009-11-25T13:12:38-00:00Re: creating history records - potential clock issues
https://www.eclipse.org/forums/index.php/mv/msg/158432/500525/#msg_500525
policy.setShouldUseDatabaseTime(true);
You also need to ensure your DatabasePlatform implements the getTimestampQuery() method (most supported platforms do).
]]>James Sutherland2009-11-26T14:29:16-00:00Re: creating history records - potential clock issues
https://www.eclipse.org/forums/index.php/mv/msg/158432/500560/#msg_500560
> The HistoryPolicy uses the local time by default, you can change this to
> the database using,
Briljant. I still need to run into the first problem that EclipseLink doesn't have a solution for.