Skip to content

Commit 0c9d50b

Browse files
authored
Merge pull request rails#50635 from ghiculescu/connection-pool-docs
Minor improvements to Connection Pool docs
2 parents 3bbf21c + b04c512 commit 0c9d50b

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,10 @@ def db_config
6868
# Connections can be obtained and used from a connection pool in several
6969
# ways:
7070
#
71-
# 1. Simply use {ActiveRecord::Base.connection}[rdoc-ref:ConnectionHandling.connection]
72-
# as with Active Record 2.1 and
73-
# earlier (pre-connection-pooling). Eventually, when you're done with
74-
# the connection(s) and wish it to be returned to the pool, you call
71+
# 1. Simply use {ActiveRecord::Base.connection}[rdoc-ref:ConnectionHandling.connection].
72+
# When you're done with the connection(s) and wish it to be returned to the pool, you call
7573
# {ActiveRecord::Base.connection_handler.clear_active_connections!}[rdoc-ref:ConnectionAdapters::ConnectionHandler#clear_active_connections!].
76-
# This will be the default behavior for Active Record when used in conjunction with
74+
# This is the default behavior for Active Record when used in conjunction with
7775
# Action Pack's request handling cycle.
7876
# 2. Manually check out a connection from the pool with
7977
# {ActiveRecord::Base.connection_pool.checkout}[rdoc-ref:#checkout]. You are responsible for

guides/source/configuring.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3614,7 +3614,7 @@ Below is a comprehensive list of all the initializers found in Rails in the orde
36143614
Database Pooling
36153615
----------------
36163616

3617-
Active Record database connections are managed by `ActiveRecord::ConnectionAdapters::ConnectionPool` which ensures that a connection pool synchronizes the amount of thread access to a limited number of database connections. This limit defaults to 5 and can be configured in `database.yml`.
3617+
Active Record database connections are managed by [`ActiveRecord::ConnectionAdapters::ConnectionPool`][] which ensures that a connection pool synchronizes the amount of thread access to a limited number of database connections. This limit defaults to 5 and can be configured in `database.yml`.
36183618

36193619
```yaml
36203620
development:
@@ -3641,6 +3641,7 @@ connection pool by incrementing the `pool` option in `database.yml`
36413641
36423642
NOTE. If you are running in a multi-threaded environment, there could be a chance that several threads may be accessing multiple connections simultaneously. So depending on your current request load, you could very well have multiple threads contending for a limited number of connections.
36433643
3644+
[`ActiveRecord::ConnectionAdapters::ConnectionPool`]: https://api.rubyonrails.org/classes/ActiveRecord/ConnectionAdapters/ConnectionPool.html
36443645
36453646
Custom Configuration
36463647
--------------------

0 commit comments

Comments
 (0)