Bugs item #18604, was opened at 2008-03-04 22:05
You can respond by visiting:
http://rubyforge.org/tracker/?func=detail&atid=7857&aid=18604&group_id=2014
Category: AR-JDBC
Group: 0.2.3
Status: Open
Resolution: None
Priority: 3
Submitted By: Greg Orlowski (gregorlowski)
Assigned to: Nobody (None)
Summary: activerecord-jdbc does not handle schemaname.tablename naming
construct with mysql
Initial Comment:
In rails with MRI + MySQL, we are able to use the following construct for
setting table names in our model classes:
set_table_name "#{databasename}.tablename"
where databasename represents a MySQL database (schema). We need to do this
because our app spans multiple databases (legacy db), and different model
classes reference different schemas (effectively databases in MySQL).
In JRuby with activerecord-jdbcmysql-adapter-0.7.2, (warbler deployed on
tomcat), we get the error (as a rails error page):
Table databasename. does not exist
(where databasename is the name of our dbschema).
I confirmed that if I remove the schema name, I can run a subset of our app
with the model classes that use the schema named as the default schema in
database.yml (in the database: section).
Rails version: 1.2.6
Gems Versions:
activerecord-jdbc-adapter-0.7.2
activerecord-jdbcmysql-adapter-0.7.2
Jars:
mysql-connector-java-5.0.4-bin.jar
jruby-complete-1.1RC2.jar
goldspike-1.5.jar
database.yml
development:
adapter: jdbcmysql
database: ourdbname
username: ouruser
password: ourpass
host: 127.0.0.1
I do have this in my environment.rb:
if RUBY_PLATFORM =~ /java/
require 'rubygems'
RAILS_CONNECTION_ADAPTERS = %w(jdbcmysql)
require 'active_record'
gem 'activerecord-jdbcmysql-adapter'
require 'active_record/connection_adapters/jdbcmysql_adapter'
end
----------------------------------------------------------------------
You can respond by visiting:
http://rubyforge.org/tracker/?func=detail&atid=7857&aid=18604&group_id=2014
_______________________________________________
Jruby-extras-devel mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/jruby-extras-devel