method
dealloc
v7.1.3.2 -
Show latest stable
- Class:
ActiveRecord::ConnectionAdapters::PostgreSQLAdapter::StatementPool
dealloc(key)private
No documentation available.
# File activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb, line 309
def dealloc(key)
# This is ugly, but safe: the statement pool is only
# accessed while holding the connection's lock. (And we
# don't need the complication of with_raw_connection because
# a reconnect would invalidate the entire statement pool.)
if conn = @connection.instance_variable_get(:@raw_connection)
conn.query "DEALLOCATE #{key}" if conn.status == PG::CONNECTION_OK
end
rescue PG::Error
end