提交 332f9d1a 编写于 作者: A Arthur Nogueira Neves

Merge pull request #24897 from maclover7/jm-fix-24844

Followup to #24844
......@@ -909,6 +909,8 @@ def remove_connection(spec_name)
# to optimise for.
def retrieve_connection_pool(spec_name)
owner_to_pool.fetch(spec_name) do
# Check if a connection was previously established in an ancestor process,
# which may have been forked.
if ancestor_pool = pool_from_any_process_for(spec_name)
# A connection was established in an ancestor process that must have
# subsequently forked. We can't reuse the connection, but we can copy
......
......@@ -45,7 +45,7 @@ module ConnectionHandling
# The exceptions AdapterNotSpecified, AdapterNotFound and +ArgumentError+
# may be returned on an error.
def establish_connection(spec = nil)
raise RuntimeError, "Anonymous class is not allowed." unless name
raise "Anonymous class is not allowed." unless name
spec ||= DEFAULT_ENV.call.to_sym
resolver = ConnectionAdapters::ConnectionSpecification::Resolver.new configurations
......@@ -93,8 +93,7 @@ def connection
attr_writer :connection_specification_name
# Return the specification id from this class otherwise look it up
# in the parent.
# Return the specification name from the current class or its parent.
def connection_specification_name
unless defined?(@connection_specification_name)
@connection_specification_name = self == Base ? "primary" : superclass.connection_specification_name
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册