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

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

Closed
chethan28 opened this issue Aug 3, 2018 · 4 comments
Labels

Comments

@chethan28
Copy link

chethan28 commented Aug 3, 2018

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
Copy link
Collaborator

yahonda commented Aug 7, 2018

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

@chethan28
Copy link
Author

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
Copy link

redouble commented Sep 1, 2018

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
Copy link

stale bot commented Oct 31, 2018

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.

@stale stale bot added the wontfix label Oct 31, 2018
@stale stale bot closed this as completed Nov 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants