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

ActiveRecord::Base.using_connection não é threadsafe #46

Open
manoelneto opened this issue Jul 4, 2019 · 0 comments
Open

ActiveRecord::Base.using_connection não é threadsafe #46

manoelneto opened this issue Jul 4, 2019 · 0 comments

Comments

@manoelneto
Copy link

DESCRIÇÃO:

Há um problema ao criar uma Thread dentro de um using connection.

entity.using_connection do
  ActiveRecord::Base.connection_config[:database] -> aponta para a entity

  Thread.new {
    ActiveRecord::Base.connection_config[:database] -> aponta para a default
  }.join
end

SOLUÇÃO:

Acredito que esse gem não esteja tão utilizada, então fazer um fork e corrigir.
https://github.com/ricardohsd/activerecord-connections.git

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