diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2014-03-17 17:13:00 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2014-03-17 17:13:00 -0700 |
commit | 8f218266bb4fa4ef2a07904b106c72fda9e182a6 (patch) | |
tree | 3065ab1e65e9577c11e04d51f12c56e4da4dba69 /activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb | |
parent | 4a69c933cf07ee296a4ae1e2612c31922019eeab (diff) | |
parent | 9e457a8654fa89fe329719f88ae3679aefb21e56 (diff) | |
download | rails-8f218266bb4fa4ef2a07904b106c72fda9e182a6.tar.gz rails-8f218266bb4fa4ef2a07904b106c72fda9e182a6.tar.bz2 rails-8f218266bb4fa4ef2a07904b106c72fda9e182a6.zip |
Merge pull request #14360 from matthewd/thread_aware_reaper
Track owning thread for connection pool
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb index e5f7913c70..bcad9f30d7 100644 --- a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb @@ -603,10 +603,6 @@ module ActiveRecord false end - def active_threadsafe? - @connection.connect_poll != PG::PGRES_POLLING_FAILED - end - # Close then reopen the connection. def reconnect! super @@ -616,7 +612,12 @@ module ActiveRecord def reset! clear_cache! - super + reset_transaction + unless @connection.transaction_status == ::PG::PQTRANS_IDLE + @connection.query 'ROLLBACK' + end + @connection.query 'DISCARD ALL' + configure_connection end # Disconnects from the database if already connected. Otherwise, this |