Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ArgumentError: wrong number of arguments (4 for 3) #1042

Closed
annabackiyam opened this issue Nov 19, 2019 · 2 comments
Closed

ArgumentError: wrong number of arguments (4 for 3) #1042

annabackiyam opened this issue Nov 19, 2019 · 2 comments
Milestone

Comments

@annabackiyam
Copy link

require 'rubygems'
require 'arjdbc'
require 'active_record'
require 'active_record/version'
require "/home/anna/sqlcl/lib/ojdbc8.jar"  # should be redundant...

ActiveRecord::Base.establish_connection(
   :adapter => 'jdbc',
   :url => 'jdbc:oracle:thin:@host:1521:dbname',
   :username=>'#####',
   :password=>'######'
 )
#ActiveRecord::Base.connection.execute("SELECT * FROM MGMT_TARGETS where rownum=1")

class MGMT_TARGETS < ActiveRecord::Base
  self.table_name = 'MGMT_TARGETS'
end
puts "records found: #{MGMT_TARGETS.all.size}"

MGMT_TARGETS.all.each do | mt |
        puts "target_name: #{mt.target_name}"
end

ArgumentError: wrong number of arguments (4 for 3)
initialize at /opt/SUN/lib/ruby/gems/gems/activerecord-jdbc-adapter-52.1-java/lib/arjdbc/abstract/core.rb:12
require 'rubygems'
new at /opt/SUN/lib/ruby/gems/gems/activerecord-jdbc-adapter-52.1-java/lib/arjdbc/jdbc/callbacks.rb:12
jdbc_connection at /opt/SUN/lib/ruby/gems/gems/activerecord-jdbc-adapter-52.1-java/lib/arjdbc/jdbc/connection_methods.rb:8
new_connection at /opt/SUN/lib/ruby/gems/gems/activerecord-5.2.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:809
checkout_new_connection at /opt/SUN/lib/ruby/gems/gems/activerecord-5.2.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:853
try_to_checkout_new_connection at /opt/SUN/lib/ruby/gems/gems/activerecord-5.2.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:832
acquire_connection at /opt/SUN/lib/ruby/gems/gems/activerecord-5.2.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:793
checkout at /opt/SUN/lib/ruby/gems/gems/activerecord-5.2.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:521
connection at /opt/SUN/lib/ruby/gems/gems/activerecord-5.2.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:380
retrieve_connection at /opt/SUN/lib/ruby/gems/gems/activerecord-5.2.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:1008
retrieve_connection at /opt/SUN/lib/ruby/gems/gems/activerecord-5.2.1/lib/active_record/connection_handling.rb:118
connection at /opt/SUN/lib/ruby/gems/gems/activerecord-5.2.1/lib/active_record/connection_handling.rb:90
load_schema! at /opt/SUN/lib/ruby/gems/gems/activerecord-5.2.1/lib/active_record/model_schema.rb:466
load_schema! at /opt/SUN/lib/ruby/gems/gems/activerecord-5.2.1/lib/active_record/attributes.rb:234
load_schema! at /opt/SUN/lib/ruby/gems/gems/activerecord-5.2.1/lib/active_record/attribute_decorators.rb:51
block in load_schema at /opt/SUN/lib/ruby/gems/gems/activerecord-5.2.1/lib/active_record/model_schema.rb:459
mon_synchronize at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/monitor.rb:214
load_schema at /opt/SUN/lib/ruby/gems/gems/activerecord-5.2.1/lib/active_record/model_schema.rb:456
attribute_types at /opt/SUN/lib/ruby/gems/gems/activerecord-5.2.1/lib/active_record/model_schema.rb:346
has_attribute? at /opt/SUN/lib/ruby/gems/gems/activerecord-5.2.1/lib/active_record/attribute_methods.rb:230
aggregate_column at /opt/SUN/lib/ruby/gems/gems/activerecord-5.2.1/lib/active_record/relation/calculations.rb:245
execute_simple_calculation at /opt/SUN/lib/ruby/gems/gems/activerecord-5.2.1/lib/active_record/relation/calculations.rb:268
perform_calculation at /opt/SUN/lib/ruby/gems/gems/activerecord-5.2.1/lib/active_record/relation/calculations.rb:238
calculate at /opt/SUN/lib/ruby/gems/gems/activerecord-5.2.1/lib/active_record/relation/calculations.rb:145
count at /opt/SUN/lib/ruby/gems/gems/activerecord-5.2.1/lib/active_record/relation/calculations.rb:52
size at /opt/SUN/lib/ruby/gems/gems/activerecord-5.2.1/lib/active_record/relation.rb:211

at /root/anna/oracle_jdbc.rb:19

@redconfetti
Copy link

redconfetti commented Dec 20, 2019

This is related to #955. We're experiencing the same issues with Rails 5.2.4 using this gem.

There was a workaround that works for me locally in my development environment, where I use 'as400' for the adapter instead of 'jdbc'. I'm having an issue doing the same in my test environment where we use H2 to emulate the Oracle database.

@headius
Copy link
Member

headius commented May 26, 2020

This issue is unfortunately not going to be fixed. We recommend users of Oracle databases use the excellent (and far better-supported) oracle-enhanced adapter: https://github.com/rsim/oracle-enhanced

@annabackiyam Please look into using that adapter instead. They have much better support for Oracle than we ever did, and they are still being actively maintained.

@redconfetti We will need help to support additional databases beyond the core three. We would be very happy to work with you to re-add support for these other databases if you would help us build and maintain that support.

@headius headius closed this as completed May 26, 2020
@headius headius added this to the WontFix milestone May 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants