-
Notifications
You must be signed in to change notification settings - Fork 165
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix FrontBase prototypes for correct time zone handling of Joda Time #512
Fix FrontBase prototypes for correct time zone handling of Joda Time #512
Conversation
…daTime Fix FrontBase prototypes for correct time zone handling of Joda Time
Hi Samuel, can you elaborate on this. Why is your prototype change making FrontBase behave like MySQL and PostgreSQL? Looking at their prototypes there is no time zone either and looking at the JodaTime javadocs there is the statement
So at first sight it doesn't make sense to use the time zone dependent SQL data types or if it is legitimate then shouldn't the prototypes for all the other database be corrected too? |
This is a complex subject. My goal was to obtain this behaviour: LocalTime and LocalDateTime should always display the same date and time even after a database or app server time zone change. That was not the case before. There is many counter intuitive things involved and the only way to make sure thing are OK is to test by changing the app server time zone with the same data. Some things I discovered in this long process:
Here is the message I sent to Geert to make sure I was OK:
The answer was:
I hope this help. |
Thanks for your detailed response. Now that makes much more sense. |
Dare I say, since this is a complex subject, can we include tests in what you are submitting? I know. Just crazy talk, yes? O well. :-) |
Crazy talk... To test the validity of this, you need a database server and at least 2 clients on different time zone, quite a complex setup. |
(sigh) I know. I just wish it bothered more people that it is so hard to set up database-specific tests for wonder. Never mind. Going back to my corner to sulk. :-) |
Just quickly, Johann writes:
I know you're just putting the question out there, but I'd be very reluctant to touch the PostgreSQL prototypes. This area is like a minefield, and we have a setup that works perfectly with the status quo. We run all our appservers and databases in UTC to eliminate this entire "server timezone changing" class of problems, and it's been pretty solid for some time now. |
It may be tricky to touch them but maybe not, need to test. I do not know the release history of PostgreSQL but the timestamp (not qualified) date type changed with release 7.3. From their documentation:
I have no idea when this occur in time and how existing database where or where not adjusted. |
Yes, I know what such kind of proposals caused trouble on the mailing list in the (far) past but here that already happened for FrontBase. This was geared more towards “are the prototypes for MySQL and PostgreSQL already correct or do I have to be cautious when I start using joda with these databases”. Correcting prototypes could perhaps be something for Wonder 7 though where a break and manual update coming from Wonder ≤ 6 would be ok. Besides that everyone should have his/her own prototype model, shouldn't they? ;) |
To make FrontBase behave like mySql and PostgreSql, we need to use TIME WITH TIME ZONE and TIMESTAMP WITH TIME ZONE columns. With regular types, values are time zone dependant.