jdbc-mysql 5.1.22 error #597

Closed
aportnov opened this Issue Dec 26, 2012 · 4 comments

Projects

None yet

2 participants

@aportnov

Looks like in "5.1.22" jdbc-mysql stopped loading mysql connector jar

version 5.1.13:
if RUBY_PLATFORM =~ /java/
require "mysql-connector-java-#{Jdbc::MySQL::VERSION}.jar"
else
warn "jdbc-mysql is only for use with JRuby"
end

version 5.1.22:

module Jdbc
module MySQL
VERSION = "5.1.22"

def self.driver_jar
  "mysql-connector-java-#{VERSION}.jar"
end

def self.load_driver(method = :load)
  send method, driver_jar
end

def self.driver_name
  'com.mysql.jdbc.Driver'
end

end
end

if $VERBOSE && (JRUBY_VERSION.nil? rescue true)
warn "Jdbc-MySQL is only for use with JRuby"
end

Sequel is throwing error in adapters/jdbc, line 44 trying to return com.mysql.jdbc.Driver, which is not loaded...

Not sure why this has been changed, but it looks like before returning a driver class there should be a call to
Jdbc::MySQL::load_driver

@jeremyevans
Owner

Have you verified with the jdbc-* maintainers to notify them of this issue? This is an undocumented backwards incompatible regression in the jdbc-* drivers (reference commit jruby/activerecord-jdbc-adapter@f15684f). Please confirm with them that they don't plan to fix this bug before I attempt to work around this in Sequel.

I really hope they realize the scope of the problem and fix it, because it sucks to have to add workarounds to Sequel to support both the new and old versions of the jdbc-* drivers. They need to be aware that AR-JDBC is not the sole user of the jdbc-* drivers, and they shouldn't make changes like that without considering other users.

@aportnov

Jeremy,

I agree with you. I will open issue with them... just wanted to let you
know. .
On Dec 26, 2012 1:50 PM, "Jeremy Evans" notifications@github.com wrote:

Have you verified with the jdbc-* maintainers to notify them of this
issue? This is an undocumented backwards incompatible regression in the
jdbc-* drivers (reference commit jruby/activerecord-jdbc-adapter@f15684fhttps://github.com/jruby/activerecord-jdbc-adapter/commit/f15684f687a8259cd6cfec87234245b8ffd86adc).
Please confirm with them that they don't plan to fix this bug before I
attempt to work around this in Sequel.

I really hope they realize the scope of the problem and fix it, because it
sucks to have to add workarounds to Sequel to support both the new and old
versions of the jdbc-* drivers. They need to be aware that AR-JDBC is not
the sole user of the jdbc-* drivers, and they shouldn't make changes like
that without considering other users.


Reply to this email directly or view it on GitHubhttps://github.com/jeremyevans/sequel/issues/597#issuecomment-11693003.

@aportnov

Jeremy,

I have opened issue with jdbc-*** team (
jruby/activerecord-jdbc-adapter#280) in case you
want to comment.

This is what I ended up doing before creating Sequel connection:

    def self.ensure_jdbc_load
        if defined?(Jdbc)
           Jdbc::constants.each{|c| c.load_driver if

c.respond_to?(:load_driver) }
end
end

This might load an extra jar, if different driver being used for testing...

On Wed, Dec 26, 2012 at 1:53 PM, Alex Portnov alex.portnov@gmail.comwrote:

Jeremy,

I agree with you. I will open issue with them... just wanted to let you
know. .
On Dec 26, 2012 1:50 PM, "Jeremy Evans" notifications@github.com wrote:

Have you verified with the jdbc-* maintainers to notify them of this
issue? This is an undocumented backwards incompatible regression in the
jdbc-* drivers (reference commit jruby/activerecord-jdbc-adapter@f15684fhttps://github.com/jruby/activerecord-jdbc-adapter/commit/f15684f687a8259cd6cfec87234245b8ffd86adc).
Please confirm with them that they don't plan to fix this bug before I
attempt to work around this in Sequel.

I really hope they realize the scope of the problem and fix it, because
it sucks to have to add workarounds to Sequel to support both the new and
old versions of the jdbc-* drivers. They need to be aware that AR-JDBC is
not the sole user of the jdbc-* drivers, and they shouldn't make changes
like that without considering other users.


Reply to this email directly or view it on GitHubhttps://github.com/jeremyevans/sequel/issues/597#issuecomment-11693003.

Alex Portnov
alex.portnov@gmail.com

@jeremyevans
Owner

Superceded by #598.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment