-
Notifications
You must be signed in to change notification settings - Fork 384
Rails 5.0 app crashes in setDateParameter with Java exception IllegalArgumentException #1061
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
Comments
Back-port from 52-stable Date#to_s actually does the wrong thing when Date::DATE_FORMATS[:default] is set to something non-standard. Fixes jruby#1061
Back-port from 52-stable Date#to_s actually does the wrong thing when Date::DATE_FORMATS[:default] is set to something non-standard. Fixes jruby#1061
Thanks for the report and debugging the problem! I back-ported the code from 52-stable in #1062. |
yeah I will do a release of 50-61 as I think a few other things have been fixed on newer versions since mid december (last releases). Technically 50.x is no longer supported. @haohaolee I recommend updating to a newer Rails sooner than later. Eventually we want to get to same policy as https://guides.rubyonrails.org/maintenance_policy.html. With that said, the time it takes to release 3 releases vs 5 releases at this point is not significant. So long as simple compat fixes come in I do not have a problem with extra releases. I also know it is difficult for Rails uses to skip past significant Rails releases and incrementally update.. So we are sympathetic. |
@haohaolee I put out a new release today. Hopefully things are working for you once you update. |
Hi folks,
We are upgrading our jruby rails app from 4.2 to 5.0 now, and encountered a weird issue. This issue is about an java exception from the Date type conversion in the postgresql jdbc adapter:
The relevant gems are:
This issue is all about the Date type conversion, we think the cause of this issue is because we have a
in some initializer, which leads to the wrong conversion in
PostgreSQLRubyJdbcConnection.java:370
:activerecord-jdbc-adapter/src/java/arjdbc/postgresql/PostgreSQLRubyJdbcConnection.java
Lines 359 to 370 in f4018da
We changed the default to_s for Date type from its default ISO8061
yyyy-mm-dd
format.But somehow it works for our 4.2 codebase, so we are wondering if this is something that needs fixing in 50-stable branch for AR-JDBC
ps: I noticed there are some changes for this file in 52-stable branch which seems fixed for this issue...
To reproduce this issue, you can just use rails scaffold to create a model to include date type and change
Date::DATE_FORMATS[:default]
to something other than ISO8601, then insert some record.Thanks very much
The text was updated successfully, but these errors were encountered: