rsim / oracle-enhanced

Oracle enhaced adapter for ActiveRecord
MIT License
549 stars 310 forks source link

ActiveRecord::ConnectionAdapters::OracleEnhancedConnectionException: "DESC table_name" failed; does it exist? #1746

Closed chethan28 closed 5 years ago

chethan28 commented 6 years ago

Steps to reproduce

Please refer https://github.com/rsim/oracle-enhanced/tree/master/guides/bug_report_templates to create an executable test case

Expected behavior

Tell us what should happen Should insert a record in the table

Actual behavior

Tell us what happens instead I tried to insert a record in the table .But ending up getting an exception

irb(main):029:0> KI_T= KnownIssueIngredientType.find_by(id: 10005)
irb(main):030:0> KI_T.known_issue_ingredient_property_values({property_type_id: 10000, value: 1})
ActiveRecord::ConnectionAdapters::OracleEnhancedConnectionException: "DESC known_issue_ingredient_property_values" failed; does it exist?

I see the table known_issue_ingredient_property_values in my SQLDeveloper Client.

This is my ActiveRecord class

class KnownIssueIngredientPropertyValue < ActiveRecord::Base
  belongs_to :property_type
  belongs_to :known_issue_ingredient_type
  has_one :ingredient_type, through: :known_issue_ingredient_type
end

System configuration

Rails version: rails 4.2.4

Oracle enhanced adapter version: activerecord-oracle_enhanced-adapter (1.6.9)

Ruby version: ruby:2.3.7

Oracle Database version: Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production PL/SQL Release 12.2.0.1.0 - Production CORE 12.2.0.1.0 Production TNS for Linux: Version 12.2.0.1.0 - Production NLSRTL Version 12.2.0.1.0 - Production

yahonda commented 6 years ago

Looks like something wrong with your environment, please validate your database.yml and SQL Developer are connecting to the same database.

chethan28 commented 6 years ago

TNS connection string in my SQL developer and the one in my database.yml match are connected to the same database. In my rails console when i use ActiveRecord::Base.connection.tables it returns known_issue_ingredient_property_values as one of the tables. Only when i try to do any of the CRUD operations on this table it return an exception. Cause: ActiveRecord::ConnectionAdapters::OracleEnhancedConnectionException: "DESC known_issue_ingredient_property_values" failed; does it exist?

redouble commented 6 years ago

I meet the save problem. My environment is:

System configuration Rails version: rails 4.2.5

Oracle enhanced adapter version: activerecord-oracle_enhanced-adapter (1.6.9)

Ruby version: jruby:9.1.17

Oracle Database version: Oracle Database 11 Express Edition - 64bit Production


I have connection the DB successfully, but when I use the activerecord model, I see this error.

my code is:

ExternalDb.establish_connection(......) ExternalDb.table_name = "users" views = ExternalDb.find_by_sql("SELECT view_name AS name FROM user_views").map{ |v| v.name }

stale[bot] commented 6 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.