-
Notifications
You must be signed in to change notification settings - Fork 328
Description
I am encountering an issue when attempting to perform bulk insertions using ActiveRecord.insert_all! into an Oracle Cloud Infrastructure (OCI) Autonomous Database Warehouse.
Here are the relevant versions from our Gemfile:
gem 'activerecord', '~> 7.1'
gem 'activerecord-oracle-enhanced-adapter', '~>7.1'
And our development environment details:
Ruby version: 3.4.1
Rails version: 7.0.x
The specific error I'm receiving is: ORA-24374: define not done before fetch or execute and fetch
This error occurs when executing the following logic:
ActiveRecord::Base.connected_to(role: :oci_adw_db) do # Assuming 'oci_adw_db' is your defined role
models_with_records.each do |model_with_records|
model_with_records[:records].each_slice(1000) do |records_slice|
model_with_records[:model].insert_all!(records_slice)
end
end
end