vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb
# Check-out a database connection from the pool.
Check-out a database connection from the pool.
Check - out a database connection from the pool .
def checkout
        conn = @connection_mutex.synchronize do
          if @checked_out.size < @connections.size
            checkout_existing_connection
          elsif @connections.size < @size
            checkout_new_connection
          end
        end
        return conn if conn
        @connection_mutex.synchronize do
          if @queue.wait(@timeout)
            checkout_existing_connection
          else
            raise ConnectionTimeoutError, "could not obtain a database connection within #{@timeout} seconds.  The pool size is currently #{@size}, perhaps you need to increase it?"
          end
        end
      end
def checkout conn = @connection_mutex . synchronize do if @checked_out . size < @connections . size checkout_existing_connection elsif @connections . size < @size checkout_new_connection end end return conn if conn @connection_mutex . synchronize do if @queue . wait ( @timeout ) checkout_existing_connection else raise ConnectionTimeoutError , "could not obtain a database connection within #{@timeout} seconds.  The pool size is currently #{@size}, perhaps you need to increase it?" end end end
Check-out a database connection from the pool.
Check - out a database connection from the pool .
# Checkout an available connection # No connections available; wait for one