ActiveRecord#columns-Problem with Oracle 11

  2 posts   Feedicon  
Replies: 1 - Last Post: May 15, 2009 13:42
by: oliver-schwantje
showing 1 - 2 of 2
 
Posted: May 15, 2009 10:26 by oliver-schwantje

We get an exception, when starting intanciating an ActiveRecord-Object.

Our Environment

jruby 1.1.5 (ruby 1.8.6 patchlevel 114) (2008-11-03 rev 7996) [i386-java]
java version "1.6.0_0"
IcedTea6 1.3.1 (6b12-0ubuntu6.4) Runtime Environment (build 1.6.0_0-b12)
rails (2.3.2)
activerecord (2.3.2)
activerecord-jdbc-adapter (0.9.1)
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - 64bit Production

Our Test-Script

require 'test_helper'  

class OracleSimpleTest < Test::Unit::TestCase

  def setup
    ActiveRecord::Base.connection.execute "CREATE TABLE DEFAULT_NUMBER (VALUE NUMBER, DATUM DATE DEFAULT sysdate)"
    ActiveRecord::Base.connection.execute "INSERT INTO DEFAULT_NUMBER (VALUE,DATUM) VALUES (0.076,'11.05.09')"
  end

  def teardown
    ActiveRecord::Base.connection.execute "DROP TABLE DEFAULT_NUMBER"
  end


  def test_default_number_precision
    klass = Class.new(ActiveRecord::Base)
    klass.set_table_name "default_number"
    obj = klass.find(:first)
    assert_equal 0.076, obj.value
    assert_not_nil obj.datum, "no date"
  end
end if defined?(JRUBY_VERSION)

The Stacktrace

1) Error:
test_default_number_precision(OracleSimpleTest):
ActiveRecord::ActiveRecordError: No message available
/home/oliver/Dokumente/entwicklung/jruby-1.1.5/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/base.rb:1276:in `columns'
/home/oliver/Dokumente/entwicklung/jruby-1.1.5/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/base.rb:1284:in `columns_hash'
/home/oliver/Dokumente/entwicklung/jruby-1.1.5/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/attribute_methods.rb:71:in `define_attribute_methods'
/home/oliver/Dokumente/entwicklung/jruby-1.1.5/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/attribute_methods.rb:242:in `method_missing'
/home/oliver/workspaceNetBeans/tools_rezension/test/unit/oracle_simple_test.rb:19:in `test_default_number_precision'
/home/oliver/Dokumente/entwicklung/jruby-1.1.5/lib/ruby/1.8/test/unit/testcase.rb:78:in `run'
/home/oliver/Dokumente/entwicklung/jruby-1.1.5/lib/ruby/1.8/test/unit/testsuite.rb:34:in `run'
/home/oliver/Dokumente/entwicklung/jruby-1.1.5/lib/ruby/1.8/test/unit/testsuite.rb:33:in `each'
/home/oliver/Dokumente/entwicklung/jruby-1.1.5/lib/ruby/1.8/test/unit/testsuite.rb:33:in `run'
/home/oliver/Dokumente/entwicklung/jruby-1.1.5/lib/ruby/1.8/test/unit/ui/testrunnermediator.rb:46:in `run_suite'

Could you help us? At the Moment jruby-Rails is unusable with oracle 11

best regards oliver

 
Posted: May 15, 2009 13:42 by oliver-schwantje
Meanwhile I know, that it's a problem of a date column.
The exception is raised in the Java-Method:
jdbc_adapter.RubyJdbcConnection#columns_internal

bye oliver
Replies: 1 - Last Post: May 15, 2009 13:42
by: oliver-schwantje
  • Mysql
  • Glassfish
  • Jruby
  • Rails
  • Nblogo
Terms of Use; Privacy Policy;
© 2010, Oracle Corporation and/or its affiliates
(revision 20120127.ac94057)
 
 
Close
loading
Please Confirm
Close