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