
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
-
Rob Sharp May 5th, 2010 @ 01:32 AM
Also, here's xaviershays hack around the issue.
http://github.com/NZX/do/commit/b2f779885f15b45b1acb78eca48c544bc45...
-
Dirkjan Bussink May 6th, 2010 @ 02:34 AM
- State changed from new to unconfirmed
I guess you're using current master branch? I want to do a release soon and fix this up. I can do a debug session over irc if you have a test environment available. Last time I tried to set it up, I got stuck and it probably will take hours to set up anyway.
I'm usually around during CET day times.
-
Rob Sharp May 7th, 2010 @ 12:36 AM
Hey Dirkjan,
This issue is with current master.
I'm in AEST (i.e. Sydney) so let's work out a time to do a debug session next week. I have a sandbox account on an Oracle box I can use.
Rob
-
Dirkjan Bussink May 13th, 2010 @ 02:22 PM
Could you try with the following changes?
https://gist.github.com/adcf6798c674e82b73a8
Otherwise it's probably easiest to get online on irc at irc://irc.freenode.net/#datamapper, I'm usually around during CET day times there.
-
-
Dan Kubb (dkubb) May 21st, 2010 @ 02:58 PM
- State changed from unconfirmed to resolved
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.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »