#1261 ✓resolved
Rob Sharp

do_oracle calls missing 'log' method on oci8 adapter

Reported by Rob Sharp | May 5th, 2010 @ 01:28 AM

I'm unable to execute any queries to an oracle database using do_oracle and datamapper.

Gems:

[robsharp@robsharp rc]$ bundle show
Gems included by the bundle:
  * actionmailer (2.3.5)
  * actionpack (2.3.5)
  * activerecord (2.3.5)
  * activerecord-oracle_enhanced-adapter (1.2.4)
  * activeresource (2.3.5)
  * activesupport (2.3.5)
  * addressable (2.1.2)
  * data_objects (0.10.2)
  * dm-core (0.10.3 master-336472)
  * dm-do-adapter (0.10.3 1d52cea8904d4da687c2fddabd5bf999c94cd21e-195cff)
  * dm-oracle-adapter (0.10.3 d36ce8a7d1ce93d1f7a42ee07b9ed1b473a52dea-9269b8)
  * do_oracle (0.10.2)
  * extlib (0.9.14)
  * rack (1.0.1)
  * rails (2.3.5)
  * rake (0.8.7)
  * rspec (1.3.0)
  * rspec-rails (1.3.2)
  * ruby-oci8 (2.0.4)

Executing the query:

[robsharp@robsharp rc]$ ruby script/console
Loading development environment (Rails 2.3.5)
/home/robsharp/.bundle/ruby/1.8/bundler/gems/dm-core-37b4bd22b9e3842977cf83d32baba459607e900a-master/lib/dm-core.rb:48: warning: already initialized constant Inflector
>> DataMapper::Logger.new($stdout, :debug)
=> #<DataMapper::Logger:0xb21e929c @level=0, @delimiter=" ~ ", @log=#<IO:0xb7f33574>, @auto_flush=true, @buffer=[], @init_args=[#<IO:0xb7f33574>, :debug]>

>> DataMapper.setup(:default, 'oracle://meh:meh@MEHDEV')
=> #<DataMapper::Adapters::OracleAdapter:0xb21e5b24 @normalized_uri=#<struct DataObjects::URI scheme="oracle", user="meh", password="meh", host="MEHDEV", port=nil, path="", query=nil, fragment=nil>, @options={"port"=>nil, "adapter"=>"oracle", "fragment"=>nil, "scheme"=>"oracle", "path"=>"", "host"=>"MEHDEV", "password"=>"meh", "user"=>"meh", "query"=>nil}, @resource_naming_convention=DataMapper::NamingConventions::Resource::UnderscoredAndPluralized, @name=:default, @field_naming_convention=DataMapper::NamingConventions::Field::Underscored>

>> CreditCard.all
 ~ undefined method `log' for #<OCI8:meh>
NoMethodError: undefined method `log' for #<OCI8:meh>
  from /home/robsharp/.bundle/ruby/1.8/bundler/gems/do-ead4d72fd14942d850490058a50494994eca82c1-master/data_objects/lib/data_objects/connection.rb:76:in `initialize'
  from /home/robsharp/.bundle/ruby/1.8/bundler/gems/do-ead4d72fd14942d850490058a50494994eca82c1-master/data_objects/lib/data_objects/connection.rb:76:in `send'
  from /home/robsharp/.bundle/ruby/1.8/bundler/gems/do-ead4d72fd14942d850490058a50494994eca82c1-master/data_objects/lib/data_objects/connection.rb:76:in `__new'
  from /home/robsharp/.bundle/ruby/1.8/bundler/gems/do-ead4d72fd14942d850490058a50494994eca82c1-master/data_objects/lib/data_objects/pooling.rb:177:in `new'
  from /home/robsharp/.bundle/ruby/1.8/bundler/gems/do-ead4d72fd14942d850490058a50494994eca82c1-master/data_objects/lib/data_objects/pooling.rb:172:in `synchronize'
  from /home/robsharp/.bundle/ruby/1.8/bundler/gems/do-ead4d72fd14942d850490058a50494994eca82c1-master/data_objects/lib/data_objects/pooling.rb:172:in `new'
  from /home/robsharp/.bundle/ruby/1.8/bundler/gems/do-ead4d72fd14942d850490058a50494994eca82c1-master/data_objects/lib/data_objects/pooling.rb:119:in `new'
  from /home/robsharp/.bundle/ruby/1.8/bundler/gems/do-ead4d72fd14942d850490058a50494994eca82c1-master/data_objects/lib/data_objects/connection.rb:65:in `new'
  from /home/robsharp/.bundle/ruby/1.8/bundler/gems/dm-do-adapter-1d52cea8904d4da687c2fddabd5bf999c94cd21e-master/lib/dm-do-adapter/adapter.rb:235:in `open_connection'
  from /home/robsharp/.bundle/ruby/1.8/bundler/gems/dm-do-adapter-1d52cea8904d4da687c2fddabd5bf999c94cd21e-master/lib/dm-do-adapter/adapter.rb:260:in `with_connection'
  from /home/robsharp/.bundle/ruby/1.8/bundler/gems/dm-do-adapter-1d52cea8904d4da687c2fddabd5bf999c94cd21e-master/lib/dm-do-adapter/adapter.rb:138:in `read'
  from /home/robsharp/.bundle/ruby/1.8/bundler/gems/dm-core-37b4bd22b9e3842977cf83d32baba459607e900a-master/lib/dm-core/repository.rb:148:in `read'
  from /home/robsharp/.bundle/ruby/1.8/bundler/gems/dm-core-37b4bd22b9e3842977cf83d32baba459607e900a-master/lib/dm-core/collection.rb:1118:in `lazy_load'
  from /home/robsharp/.bundle/ruby/1.8/bundler/gems/dm-core-37b4bd22b9e3842977cf83d32baba459607e900a-master/lib/dm-core/support/lazy_array.rb:411:in `each'
  from /home/robsharp/.bundle/ruby/1.8/bundler/gems/dm-core-37b4bd22b9e3842977cf83d32baba459607e900a-master/lib/dm-core/collection.rb:510:in `each'
  from /home/robsharp/.bundle/ruby/1.8/bundler/gems/dm-core-37b4bd22b9e3842977cf83d32baba459607e900a-master/lib/dm-core/collection.rb:977:in `map'
  from /home/robsharp/.bundle/ruby/1.8/bundler/gems/dm-core-37b4bd22b9e3842977cf83d32baba459607e900a-master/lib/dm-core/collection.rb:977:in `inspect'
  from /usr/local/lib/ruby/1.8/irb.rb:302:in `output_value'
  from /usr/local/lib/ruby/1.8/irb.rb:151:in `eval_input'
  from /usr/local/lib/ruby/1.8/irb.rb:263:in `signal_status'
  from /usr/local/lib/ruby/1.8/irb.rb:147:in `eval_input'
  from /usr/local/lib/ruby/1.8/irb.rb:146:in `eval_input'
  from /usr/local/lib/ruby/1.8/irb.rb:70:in `start'
  from /usr/local/lib/ruby/1.8/irb.rb:69:in `catch'
  from /usr/local/lib/ruby/1.8/irb.rb:69:in `start'
  from /usr/local/bin/irb:13>>

And the model:

class CreditCard
  include DataMapper::Resource
  storage_names[:default] = 'CREDITCARD'

  property :id, String, :key => true, :field => 'RECNO'
  property :annual_fee, String, :field => 'FEESANNU'
  property :application_fee, String, :field => 'FEESAPPL'
end

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Tags

Pages