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

using ibm_db2 along with postgres is causing a problem with 'create savepoints' #173

Open
Naren1997 opened this issue Jul 26, 2024 · 1 comment

Comments

@Naren1997
Copy link

Hello Team,

We have two DB connections in our project, one is for storing data in our Postgres DB, another connection is for IBM DB2, which has the actual data in it, we get the data from DB2 and puts in our Postgres DB. With Postgres adaptor connection, when we have the code that calls the 'create_savepoint' method, instead of calling the code for Postgres adaptor its going to IBM DB adaptor's, I'm getting error undefined method puts_log for Postgres adaptor. It looks the issue is with https://github.com/ibmdb/ruby-ibmdb/blob/master/IBM_DB_Adapter/ibm_db/lib/active_record/connection_adapters/ibm_db_adapter.rb#L502 code such that it'll override the actual https://github.com/rails/rails/blob/main/activerecord/lib/active_record/connection_adapters/abstract/savepoints.rb#L6

environment usage
ruby 3.1.2
rails 7.0.8
postgres14.3
pg gem version 1.5.5
ibm_db gem version 5.4.1

database.yml
default: &default
primary:
adapter: postgresql
schema_search_path: 'blueid'
db2_source:
database_tasks: false
adapter: ibm_db
schema: blueid
encoding: utf8

@Naren1997
Copy link
Author

the db2 package has this same pattern as rails have, thus ending up overloading the rails one (though db2 connection is not used)

module ActiveRecord
 module ConnectionAdapters
  module Savepoints
   def create_savepoint(name = current_savepoint_name)
   end
  end
 end
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant