[英]active record stand alone: connection pooling
Using activerecord
outside rails, may I be confident all the connection drudgework is performed behind the curtains the same as inside rails? 使用
activerecord
外导轨,我是否可以确定所有连接工作都像在窗帘内部一样在幕后进行?
In rails, activerecord
does a great job establishing a connection pool and activating or closing connection as needed. 在rails中,
activerecord
可以很好地建立连接池并根据需要激活或关闭连接。
If I have a ruby daemon which calls a class file with: 如果我有一个ruby守护程序,该守护程序使用以下命令调用类文件:
ActiveRecord::Base.establish_connection(:production)
# more active_record tasks
can I assume on the following calls a connection from a pool is used? 我可以假设在以下调用中使用了来自池的连接吗?
是的,调用ActiveRecord::Base.establish_connection
将根据ActiveRecord::Base.establish_connection
内容创建连接池: https : //github.com/rails/rails/blob/master/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb#L842
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.