You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
WARN: driver does not support checking if connection isValid() please make sure you're using a JDBC 4.0 compilant driver or set `connection_alive_sql: ...` in your database configuration
rake aborted!
Java::JavaLang::AbstractMethodError: com.ibm.db2.jcc.t4.b.isValid(I)Z
arjdbc.jdbc.RubyJdbcConnection.isConnectionValid(RubyJdbcConnection.java:2696)
arjdbc.jdbc.RubyJdbcConnection.active_p(RubyJdbcConnection.java:478)
Quick workaround was to add connection_alive_sql: SELECT 1 FROM sysibm.tables FETCH FIRST 1 ROWS ONLY to the default section, however then this blows up:
wrong number of arguments calling `initialize` (1 for 4)/home/bbozo/dev/activerecord-jdbc-adapter/lib/arjdbc/db2/adapter.rb:200:in `zos_create_table'
/home/bbozo/dev/activerecord-jdbc-adapter/lib/arjdbc/db2/adapter.rb:192:in `create_table'
OK, zos? is defined on https://github.com/jruby/activerecord-jdbc-adapter/blob/master/lib/arjdbc/db2/adapter.rb#L620 and I find #546 so things seem clear - zos? support (whatever it is) didn't get updated with rails 4 and the thing doesn't work with the outdated url: parameter, all I need to do is switch from url: to jdbc_url: or define host, port etc in separate tags and all will be fine once I update README.md, however:
In the end I cargo culted the IBM data admin connection string url: jdbc:db2://localhost:50000/BBOZO instead of one from README.md just to get around the zos? regexp condition (https://github.com/jruby/activerecord-jdbc-adapter/blob/master/lib/arjdbc/db2/adapter.rb#L625), but I have no idea what the implications of this are, rake db:migrate went through which I guess is enough to start development YAY :)
I guess, however, that this isn't an optimal setting to go to production? And that at least the docs need to be updated as well as possibly several other issues as well, I'll push my test DB2 rails app to github in a minute
The text was updated successfully, but these errors were encountered:
@bbozo great detail ... I tihnk you'll definitely crack this down. you assumed the config[:url] wrong - it still works (with Rails 4.x) Rails core incorporated a work-around for JRuby - they simply do not parse.
I'll recommend keeping the JDBC url as is and instead concentrate on making a 4.x compatible zos_create_table ... you should also try using adapter: db2 but you will still hit the create table thing!
Hi all :)
Docs say that the following YAML should be used for DB2:
However, the following
database.yml
snippetyields an abstract method error:
I can tell that the driver at least seems to handle this https://github.com/jruby/activerecord-jdbc-adapter/blob/master/lib/arjdbc/db2/connection_methods.rb#L17 but for some reason it doesn't seem to "sink in"
Quick workaround was to add
connection_alive_sql: SELECT 1 FROM sysibm.tables FETCH FIRST 1 ROWS ONLY
to thedefault
section, however then this blows up:And sure enough, there's a line saying
NOTE: this won't work for 4.0 - need to pass different initialize args
on https://github.com/jruby/activerecord-jdbc-adapter/blob/master/lib/arjdbc/db2/adapter.rb#L199 so I guessed that's mistery solved because all I need to do is make it to not bezos?
:)OK,
zos?
is defined on https://github.com/jruby/activerecord-jdbc-adapter/blob/master/lib/arjdbc/db2/adapter.rb#L620 and I find #546 so things seem clear -zos?
support (whatever it is) didn't get updated withrails 4
and the thing doesn't work with the outdatedurl:
parameter, all I need to do is switch fromurl:
tojdbc_url:
or definehost
,port
etc in separate tags and all will be fine once I updateREADME.md
, however:In the end I cargo culted the IBM data admin connection string
url: jdbc:db2://localhost:50000/BBOZO
instead of one fromREADME.md
just to get around thezos?
regexp condition (https://github.com/jruby/activerecord-jdbc-adapter/blob/master/lib/arjdbc/db2/adapter.rb#L625), but I have no idea what the implications of this are,rake db:migrate
went through which I guess is enough to start development YAY :)I guess, however, that this isn't an optimal setting to go to production? And that at least the docs need to be updated as well as possibly several other issues as well, I'll push my test DB2 rails app to github in a minute
The text was updated successfully, but these errors were encountered: