MySQL Replication Driver & ActiveRecord JDBC - ³no conne ction available²

Hi,

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?

Thanks,
Mike

Hi Mike,

On Wed, Jun 9, 2010 at 6:43 PM, Mike W. [email protected] wrote:

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,
/Nick


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Hey Nick,

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?

-M

On 6/11/10 9:48 AM, “Nick S.” [email protected] wrote:

Hi Mike,

On Wed, Jun 9, 2010 at 6:43 PM, Mike W. [email protected] wrote:

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,
/Nick


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

It’s a possibility – you could try turning connection pooling off
with the following monkey patch and see if it makes a difference.

/Nick

On Fri, Jun 11, 2010 at 7:52 PM, Mike W. [email protected] wrote:

have so far had no success.


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

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.

-M

On 6/14/10 8:38 AM, “Nick S.” [email protected] wrote:

It’s a possibility – you could try turning connection pooling off
with the following monkey patch and see if it makes a difference.

/Nick

On Fri, Jun 11, 2010 at 7:52 PM, Mike W. [email protected] wrote:

have so far had no success.


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Yes- it was the same error. I did confirm that it is in fact loading the
override by adding some debugging lines inside checkin.

Heres the output from my test:
gist:438238 · GitHub

-M

On 6/14/10 12:53 PM, “Nick S.” [email protected] wrote:

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.

On Mon, Jun 14, 2010 at 2:43 PM, Mike W. [email protected] wrote:

with the following monkey patch and see if it makes a difference.

second part of the gist).
On Wed, Jun 9, 2010 at 6:43 PM, Mike W. [email protected] wrote:

database: �adapter: jdbc · GitHub

To unsubscribe from this list, please visit:

����http://xircles.codehaus.org/manage_email


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

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.

On Mon, Jun 14, 2010 at 2:43 PM, Mike W. [email protected] wrote:

with the following monkey patch and see if it makes a difference.

second part of the gist).
On Wed, Jun 9, 2010 at 6:43 PM, Mike W. [email protected] wrote:

database: adapter: jdbc · GitHub

To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email