Closed mohamedhafez closed 3 years ago
Hmm...we already ship v8.0.17 of jdbc-mysql
. My guess is that this hasn't been updated for you because activerecord-jdbc-adapter
allows a wide range of versions as dependency.
Can you check which version bundle actually uses? It might be necessary to be more specific in your Gemfile
like this:
gem 'jdbc-mysql', '~> 8.0.17', platforms: [:jruby]
When I tried adding that to my Gemfile, I got this error:
Bundler could not find compatible versions for gem "jdbc-mysql":
In Gemfile:
jdbc-mysql (~> 8.0.17) java
activerecord-jdbcmysql-adapter (= 60.3) java was resolved to 60.3, which
depends on
jdbc-mysql (~> 5.1.36, < 9) universal-java-11
Note the ~> 5.1.36
requirement limits jdbc-mysql
to the 5.1.* series. Perhaps >
was intended instead of ~>
?
EDIT: the above was for activerecord-jdbcmysql-adapter version 60.3, but version 61.0 also has the same jdbc-mysql (~> 5.1.36, < 9)
requirement
Ouch...yes that's wrong and needs fixing (MR in #1083)
Meanwhile, you can change you Gemfile
a bit as you don't really need activerecord-jdbcmysql-adapter
. For most part it's just:
require 'arjdbc'
require 'arjdbc/mysql'
So basically, as long as you have adapter: mysql
and not adapter: jdbcmysql
, the following should work due to auto-loading tricks. (At least it does for me with the postgresql adapter)
gem 'activerecord-jdbc-adapter', '~> 60.3', platforms: [:jruby]
gem 'jdbc-mysql', '~> 8.0.17', platforms: [:jruby]
it will lazy-load the arjdbc/mysql
, but that should be fine. Otherwise just add the require 'arjdbc/mysql'
at the end of boot.rb
.
This has been fixed for 52.x, 60.x, and 61.x from #1083 and we have new releases.
The versions of MySQL Connector/J used in activerecord-jdbcmysql-adapter have this bug in them which is causing me to receive lots of ssl errors like the one posted below (also see https://github.com/mysql/mysql-connector-j/pull/32). This bug is fixed as of MySQL Connector/J versions 8.0.16 and 5.1.48, is there any chance we could get an upgrade to these?
The issue affects connecting to a MySQL database via SSL from Java 11. To reproduce this in jruby, just run
rake db:migrate
on a rails app. Below is what I get every time, as well as frequently throughout the day in the normal operation of my rails app. (I'm connecting to a MySQL 8.0 database, but it sounds like it affects all versions of MySQL)