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

uninitialized constant ActiveRecord::ConnectionAdapters::ClosedTransaction #189

Closed
ShogunPanda opened this issue Jan 31, 2015 · 19 comments
Closed

Comments

@ShogunPanda
Copy link

Hi. I just upgraded to em-synchrony 1.0.4.
Whenever I try to make any operation with ActiveRecord I get this error using ActiveRecord 4.2.0:

Failure/Error: Unable to find matching line from backtrace
   NameError:
     uninitialized constant ActiveRecord::ConnectionAdapters::ClosedTransaction
   # /Volumes/DATI/Users/Shogun/.rvm/gems/ruby-2.2.0/gems/em-synchrony-1.0.4/lib/em-synchrony/activerecord.rb:92:in `reset_transaction'
   # /Volumes/DATI/Users/Shogun/.rvm/gems/ruby-2.2.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/database_statements.rb:6:in `initialize'
   # /Volumes/DATI/Users/Shogun/.rvm/gems/ruby-2.2.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/query_cache.rb:24:in `initialize'
   # /Volumes/DATI/Users/Shogun/.rvm/gems/ruby-2.2.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract_adapter.rb:102:in `initialize'
   # /Volumes/DATI/Users/Shogun/.rvm/gems/ruby-2.2.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:163:in `initialize'
   # /Volumes/DATI/Users/Shogun/.rvm/gems/ruby-2.2.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/mysql2_adapter.rb:35:in `initialize'
   # /Volumes/DATI/Users/Shogun/.rvm/gems/ruby-2.2.0/gems/em-synchrony-1.0.4/lib/active_record/connection_adapters/em_mysql2_adapter.rb:34:in `new'
   # /Volumes/DATI/Users/Shogun/.rvm/gems/ruby-2.2.0/gems/em-synchrony-1.0.4/lib/active_record/connection_adapters/em_mysql2_adapter.rb:34:in `em_mysql2_connection'
   # /Volumes/DATI/Users/Shogun/.rvm/gems/ruby-2.2.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:436:in `new_connection'
   # /Volumes/DATI/Users/Shogun/.rvm/gems/ruby-2.2.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:446:in `checkout_new_connection'
   # /Volumes/DATI/Users/Shogun/.rvm/gems/ruby-2.2.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:422:in `acquire_connection'
   # /Volumes/DATI/Users/Shogun/.rvm/gems/ruby-2.2.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:349:in `block in checkout'
   # /Volumes/DATI/Users/Shogun/.rvm/gems/ruby-2.2.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:348:in `checkout'
   # /Volumes/DATI/Users/Shogun/.rvm/gems/ruby-2.2.0/gems/em-synchrony-1.0.4/lib/em-synchrony/activerecord.rb:12:in `block in connection'
   # /Volumes/DATI/Users/Shogun/.rvm/gems/ruby-2.2.0/gems/em-synchrony-1.0.4/lib/em-synchrony/thread.rb:63:in `synchronize'
   # /Volumes/DATI/Users/Shogun/.rvm/gems/ruby-2.2.0/gems/em-synchrony-1.0.4/lib/em-synchrony/activerecord.rb:11:in `connection'

Can you please fix it? :)

@Ravenstine
Copy link

I would also like to see this issue solved.

@johnnaegle
Copy link

+1

johnnaegle added a commit to GoodMeasuresLLC/activerecord-import that referenced this issue Feb 21, 2015
This pins the Gemfile to 1.0.3 which seems to work.
@kkempin
Copy link

kkempin commented Feb 26, 2015

+1

@est
Copy link

est commented Feb 28, 2015

+1 same error here. Rollback to 1.0.3 fixed the problem.

dgutov added a commit to dgutov/em-synchrony that referenced this issue Mar 6, 2015
@vkill
Copy link

vkill commented Mar 7, 2015

+1

dgutov added a commit to dgutov/em-synchrony that referenced this issue Mar 8, 2015
@pcriv
Copy link

pcriv commented Mar 17, 2015

+1

2 similar comments
@genail
Copy link

genail commented Apr 28, 2015

+1

@markalanevans
Copy link

+1

@Freeza91
Copy link

+1
Rollback to 1.0.3 can solve this problem.
Hope this issue to be solved soon.

@vkill
Copy link

vkill commented May 15, 2015

rollback activerecord to 4.1.9

@Aetherus
Copy link

+1
4.1.10 is okay too.
Eager to see this issue being fixed so that we can leverage rails 4.2's active job.

@coxoc
Copy link

coxoc commented Dec 25, 2015

Fixed with the following patch.(not tested in production environment)

if ::ActiveRecord::VERSION::STRING >= "4.2.0"
  module EM::Synchrony
    module ActiveRecord
      module Adapter
        def reset_transaction
          @transaction_manager = ::ActiveRecord::ConnectionAdapters::TransactionManager.new(self)
        end

        delegate :open_transactions, :current_transaction, :begin_transaction, :commit_transaction, :rollback_transaction, to: :transaction_manager
      end
    end
  end
end

zdennis added a commit to zdennis/activerecord-import that referenced this issue Jan 15, 2016
igrigorik/em-synchrony#189

* em-synchrony 1.0.3 is required for ActiveRecord 3.x
* em-syncrhony 1.0.4 is happy for ActiveRecord 4.x (although in some cases it is still fine with 1.0.3)
zdennis added a commit to zdennis/activerecord-import that referenced this issue Jan 15, 2016
igrigorik/em-synchrony#189

* em-synchrony 1.0.3 is required for ActiveRecord 3.x
* em-syncrhony 1.0.4 is happy for ActiveRecord 4.x (although in some cases it is still fine with 1.0.3)
@ShogunPanda
Copy link
Author

Any update on this?

@dgutov
Copy link
Collaborator

dgutov commented Apr 1, 2016

Should be fixed now with 6c88bbf (although no new release yet).

@ShogunPanda
Copy link
Author

Ok, any ETA for the new release?

@igrigorik
Copy link
Owner

@dgutov @ShogunPanda we're overdue for a release; I can push one out. That said, I'd love to see if we can get #190 in first.

@dgutov
Copy link
Collaborator

dgutov commented Apr 4, 2016

@igrigorik From what I understand of #190, it would require a major version bump. I think it would be better to push out a backward-compatible release first.

@igrigorik
Copy link
Owner

@dgutov sounds reasonable. Side topic: can you please ping me on [email protected]? :)

@dgutov
Copy link
Collaborator

dgutov commented May 9, 2016

The new version has been released.

@dgutov dgutov closed this as completed May 9, 2016
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