instance method
lease
Ruby on Rails 5.0.7.2
Since v3.2.22.5Signature
lease()
this method must only be called while holding connection pool’s mutex
Source
# File activerecord/lib/active_record/connection_adapters/abstract_adapter.rb, line 165
def lease
if in_use?
msg = 'Cannot lease connection, '
if @owner == Thread.current
msg << 'it is already leased by the current thread.'
else
msg << "it is already in use by a different thread: #{@owner}. " <<
"Current thread: #{Thread.current}."
end
raise ActiveRecordError, msg
end
@owner = Thread.current
end
Defined in activerecord/lib/active_record/connection_adapters/abstract_adapter.rb line 165
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::ConnectionAdapters::AbstractAdapter