Verifying MySQL connection options in JRoR

All,

I am attempting to deploy a Rails app. via the Goldspike plugin into a
Websphere container. I can’t seem to find a definitive place that
summarizes the different ways to connect to MySQL from within JRoR, so I
thought I would verify what I think I understand and ask about what I
don’t here.

I see that there are 3 gems related to connecting to MySQL that are
available:

jruby-mysql
activerecord-jdbc-adapter
activerecord-jdbcmysql-adapter

  1. Is jruby-mysql used as JRuby-ized version of the C Ruby mysql gem?
    So if I want to connect without JDBC (implying that my database.yml
    wouldn’t change from what it normally would be in regular Rails), is
    this what I would use?

  2. If I want to connect via JDBC, I’m assuming that I need both the
    jdbc-adapter and the jdbcmysql-adapter (I’m guessing that the
    jdbc-adapter was split up at some point so that the “driver manager” is
    in jdbc-adapter and then each driver gets its own gem (e.g.
    jdbcmysql-adapter). Is that right?

  3. If I do need both the jdbc-adapter and the jdbcmysql-adapter to
    connect via JDBC, I’m noticing that the Goldspike plugin doesn’t pull in
    the jdbcmysql-adapter into the gems directory in my WAR file - so I need
    to do this by hand?

[FWIW - As I am on Rails 1.2.3 for this app., I’m using the 0.7.2
versions of jdbc-adapter and jdbcmysql-adapter.]

Any insight would be appreciated.

Thanks,
Wes

I have my DB connection via JDBC working.

It appears that all three of these libraries (activerecord-jdbc-adapter,
activerecord-jdbcmysql-adapter, jdbc-mysql) are required to successfully
use JDBC to connect to MySQL.

Can anyone explain what’s in each one?

Thanks,
Wes

Wes G. wrote:

I have my DB connection via JDBC working.

It appears that all three of these libraries (activerecord-jdbc-adapter,
activerecord-jdbcmysql-adapter, jdbc-mysql) are required to successfully
use JDBC to connect to MySQL.

Can anyone explain what’s in each one?

Thanks,
Wes

I’m attempting the exact same setup. I have all 3 gems installed and
still cannot get the application to start. I keep receiving this error:

Error 503: The server is currently overloaded, please try again later

Any insight on how your database.yml is formatted, or if there are any
additional configurations you need to do from within WebSphere?

Brad Miller wrote:

Error 503: The server is currently overloaded, please try again later

Any insight on how your database.yml is formatted, or if there are any
additional configurations you need to do from within WebSphere?

This is some kind of fscked up Websphere thing - I believe that it means
that WS has run out of memory. Bounce the Websphere server and see if
it works then.

Websphere sucks a**, huh?

Wes

Wes G. wrote:

Brad Miller wrote:

Error 503: The server is currently overloaded, please try again later

Any insight on how your database.yml is formatted, or if there are any
additional configurations you need to do from within WebSphere?

This is some kind of fscked up Websphere thing - I believe that it means
that WS has run out of memory. Bounce the Websphere server and see if
it works then.

Websphere sucks a**, huh?

Wes

WebSphere isn’t my ideal choice for running a rails app by any means. I
can get the application up and running when I disable Active Record. But
I get the 503 error when I include all of the jdbc gems.

My database.yml is formatted like this:

production:
adapter: jdbcmysql
encoding: utf8
database: whatever
username: root
password:
socket: /var/lib/mysql/mysql.sock

I’ve got the following gems:
activerecord-jdbc-adapter (0.7.2)
activerecord-jdbcmysql-adapter (0.7.2)
jdbc-mysql (5.0.4)

Brad Miller wrote:

Wes G. wrote:

Brad Miller wrote:

Error 503: The server is currently overloaded, please try again later

Any insight on how your database.yml is formatted, or if there are any
additional configurations you need to do from within WebSphere?

This is some kind of fscked up Websphere thing - I believe that it means
that WS has run out of memory. Bounce the Websphere server and see if
it works then.

Websphere sucks a**, huh?

Wes

WebSphere isn’t my ideal choice for running a rails app by any means. I
can get the application up and running when I disable Active Record. But
I get the 503 error when I include all of the jdbc gems.

My database.yml is formatted like this:

production:
adapter: jdbcmysql
encoding: utf8
database: whatever
username: root
password:
socket: /var/lib/mysql/mysql.sock

I’ve got the following gems:
activerecord-jdbc-adapter (0.7.2)
activerecord-jdbcmysql-adapter (0.7.2)
jdbc-mysql (5.0.4)

Brad,

I can’t remember where but you can modify the Java memory params. for
Websphere startup if this happens right after you restart the Websphere
server. I have to assume that there is genuine memory pressure here.

Wes