Created
February 25, 2013 23:27
-
-
Save tomharris/5034307 to your computer and use it in GitHub Desktop.
The connection is not properly checked-out of the connection pool. AR may give it to other threads to use
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module DataLoad | |
class Thing1 | |
def reload_all | |
connection = ActiveRecord::Base.connection | |
sql = <<-SQL | |
create temporary table tmp_thing1 ( | |
-- ... | |
) | |
SQL | |
connection.execute(sql) | |
sql = <<-SQL | |
-- Load data | |
SQL | |
connection.execute(sql) | |
sql = <<-SQL | |
-- Do things with the data | |
SQL | |
connection.execute(sql) | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment