NameError: uninitialized constant ActiveRecord::ConnectionAdapters::DatabaseStatements::TransactionManager when calling reset_transaction #26441
Labels
Comments
#26273 may be related |
@matthewd is this related to code reload? |
If it helps to mention it, this happened in production mode. |
@synthead does your app has any special |
@arthurnn it shouldn't be -- these classes don't get unloaded. But given that something is clearly doing the wrong thing, I wouldn't rule it out. |
This is in module MyApp
class Application < Rails::Application
# Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/initializers
# -- all .rb files in that directory are automatically loaded.
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
# config.time_zone = 'Central Time (US & Canada)'
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
# config.i18n.default_locale = :de
# Do not swallow errors in after_commit/after_rollback callbacks.
config.active_record.raise_in_transactional_callbacks = true
# Include ActiveJob concerns when application is eager-loaded.
config.eager_load_paths.unshift(config.root.join("app/jobs/concerns").to_s)
# Allow WebSocket requests from any origin.
config.action_cable.disable_request_forgery_protection = true
config.after_initialize do
Rails.application.eager_load!
::ACTIONS_MAP = Hash.new.tap do |my_app_actions|
ActiveJob::Base.descendants.each do |descendant|
if descendant.included_modules.include?(MyApp)
action = descendant.name.underscore.chomp("_job")
my_app_actions[action] = descendant
end
end
end
end
end
end Think this might be causing issues? The strange thing is that it happened unexpectedly about a day after a number of Sidekiq jobs went though. |
Awesome! Thanks so much! |
arthurnn
added a commit
that referenced
this issue
Sep 23, 2016
Merged
arthurnn
pushed a commit
that referenced
this issue
Sep 23, 2016
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Saw this exception pop up. I'm not sure how or why it happened, so I can't provide steps to reproduce it, but I'm happy to try anything to help.
Something tells me that this line...
...should probably be updated to...
Also, it looks like the two tests actually call
TransactionManager
explicitly, so I believe that thereset_transaction
method doesn't have a test to catch the above exception:System configuration
Rails version: 5.0.0.1
Ruby version: 2.3.1p112
The text was updated successfully, but these errors were encountered: