raiseConnectionTimeoutError,"could not obtain a database connection#{" within #{@timeout} seconds"if@timeout}. The max pool size is currently #{@size}; consider increasing it."
end
end
...
...
@@ -246,7 +252,7 @@ def checkout
defcheckin(conn)
@connection_mutex.synchronizedo
conn.run_callbacks:checkindo
@checked_out.deleteconn
conn.expire
@queue.signal
end
end
...
...
@@ -270,21 +276,19 @@ def checkout_new_connection
c=new_connection
@connections<<c
checkout_and_verify(c)
end
defcheckout_existing_connection
c=(@connections-@checked_out).first
checkout_and_verify(c)
c
end
defcheckout_and_verify(c)
c.run_callbacks:checkoutdo
c.verify!
@checked_out<<c
end
c
end
defchecked_out
@connections.find_all{|c|c.in_use?}
end
end
# ConnectionHandler is a collection of ConnectionPool objects. It is used