Skip to content

Instantly share code, notes, and snippets.

@0xradical
Last active August 29, 2015 13:57
Show Gist options
  • Select an option

  • Save 0xradical/9381441 to your computer and use it in GitHub Desktop.

Select an option

Save 0xradical/9381441 to your computer and use it in GitHub Desktop.
Debugging transactions ...
ObjectSpace.each_object(ActiveRecord::ConnectionAdapters::Transaction).map do |a|
[a.object_id, a.class, a]
end
ObjectSpace.each_object(ActiveRecord::ConnectionAdapters::Mysql2Adapter).map do |a|
[a.object_id, a.class, a]
end
ObjectSpace.each_object(ActiveRecord::ConnectionAdapters::Mysql2Adapter).map do |a|
[a.object_id, a.open_transactions]
end
ObjectSpace.each_object(ActiveRecord::ConnectionAdapters::ConnectionPool).map do |a|
[a.object_id]
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment