Not sure if this is the best place to ask this question, but I’m trying
to get AR-JDBC and a Rails app to use the
com.mysql.jdbc.ReplicationDriver and have so far had no success.
I’m getting a “no connection available” error whenever I try to access
the database: adapter: jdbc · GitHub
Someone on #jruby suggested changing the adapter to jdbcmysql, this
required patching my local gem install of AR-JDBC 0.91 to prefer
config[:driver] as the jdbcmysql adapter was hard-coding
com.mysql.jdbc.Driver, and appears to yield the same error.
Thoughts?
p.s. is anyone using the replication driver with AR-JDBC in production?
required patching my local gem install of AR-JDBC 0.91 to prefer
config[:driver] as the jdbcmysql adapter was hard-coding
com.mysql.jdbc.Driver, and appears to yield the same error.
Thoughts?
p.s. is anyone using the replication driver with AR-JDBC in production?
I haven’t heard of anyone using the replication driver yet. According
to the code, it looks like jdbc_mysql.rb hard-codes the regular driver
and does not allow you to override it. You’ll have to apply this patch
to your ar-jdbc to be able to override it. I’ll commit this to ar-jdbc
master and it will go in the next release.
Thanks for your reply. I noticed that it was hard-coded too, I ended up
patching my local gem install but still getting the same error (see the
second part of the gist).
Could it be possible that the AR connection pooling isn’t compatible
with the Replication driver?
required patching my local gem install of AR-JDBC 0.91 to prefer
config[:driver] as the jdbcmysql adapter was hard-coding
com.mysql.jdbc.Driver, and appears to yield the same error.
Thoughts?
p.s. is anyone using the replication driver with AR-JDBC in production?
I haven’t heard of anyone using the replication driver yet. According
to the code, it looks like jdbc_mysql.rb hard-codes the regular driver
and does not allow you to override it. You’ll have to apply this patch
to your ar-jdbc to be able to override it. I’ll commit this to ar-jdbc
master and it will go in the next release.
Thanks — where would be the best place to put this override? I added it
as a config/initializer but still seeing the same error. Wondering if I
need to load it earlier.
An initializer should work just fine. Do you see the error before
that? Maybe you do need to make sure it gets loaded before the DB
connection is established. Although I’m not sure why establishing a
connection with or without pooling would make a difference.
An initializer should work just fine. Do you see the error before
that? Maybe you do need to make sure it gets loaded before the DB
connection is established. Although I’m not sure why establishing a
connection with or without pooling would make a difference.