instance method
release_connection
Ruby on Rails 7.1.6
Since v2.2.3Signature
release_connection(owner_thread = ActiveSupport::IsolatedExecutionState.context)
Signal that the thread is finished with the current connection. #release_connection releases the connection-thread association and returns the connection to the pool.
This method only works for connections that have been obtained through #connection or #with_connection methods, connections obtained through #checkout will not be automatically released.
Parameters
-
owner_threadopt = ActiveSupport::IsolatedExecutionState.context
Source
# File activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb, line 207
def release_connection(owner_thread = ActiveSupport::IsolatedExecutionState.context)
if conn = @thread_cached_conns.delete(connection_cache_key(owner_thread))
checkin conn
end
end
Defined in activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb line 207
· View on GitHub
· Improve this page
· Find usages on GitHub