Skip to content

Rails 7 insert_all! not working #2435

@Meaheesha

Description

@Meaheesha

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions