aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/caching
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2008-09-02 18:21:36 +0200
committerJeremy Kemper <jeremy@bitsweat.net>2008-09-02 18:32:54 +0200
commit6f932b4790371e548c0df9033da96b2cf8f51dcc (patch)
treeb62c70a90a1716f49df5630e14ef1d847e7a7138 /actionpack/lib/action_controller/caching
parent300754509b6990b387b056c122e90f50a79eeb81 (diff)
parentebfa43c423ac16bb699424d8d3db11855dd79a91 (diff)
downloadrails-6f932b4790371e548c0df9033da96b2cf8f51dcc.tar.gz
rails-6f932b4790371e548c0df9033da96b2cf8f51dcc.tar.bz2
rails-6f932b4790371e548c0df9033da96b2cf8f51dcc.zip
Database connections are now pooled, one pool per #establish_connection call.
Pools start out empty and grow as necessary to a maximum size (default is 5, configure size with key 'pool' in your database configuration). If no connections are available, a thread will wait up to a 'wait_timeout' time (default is 5 seconds). Connections are verified and reset when checked out from the pool (usually upon first access to ActiveRecord::Base.connection), and returned back to the pool after each request. If you would like to use connection pools outside of ActionPack, there is an ActiveRecord::Base.connection_pool method that gives you access to the pool, and you can manually checkout/checkin connections, or supply a block to ActiveRecord::Base.connection_pool.with_connection which takes care of the checkout/checkin for you. [#936 state:resolved]
Diffstat (limited to 'actionpack/lib/action_controller/caching')
-rw-r--r--actionpack/lib/action_controller/caching/actions.rb4
-rw-r--r--actionpack/lib/action_controller/caching/sweeping.rb6
2 files changed, 5 insertions, 5 deletions
diff --git a/actionpack/lib/action_controller/caching/actions.rb b/actionpack/lib/action_controller/caching/actions.rb
index f3535f8330..e72434074e 100644
--- a/actionpack/lib/action_controller/caching/actions.rb
+++ b/actionpack/lib/action_controller/caching/actions.rb
@@ -90,7 +90,7 @@ module ActionController #:nodoc:
set_content_type!(controller, cache_path.extension)
options = { :text => cache }
options.merge!(:layout => true) if cache_layout?
- controller.send!(:render, options)
+ controller.__send__(:render, options)
false
else
controller.action_cache_path = cache_path
@@ -121,7 +121,7 @@ module ActionController #:nodoc:
end
def content_for_layout(controller)
- controller.response.layout && controller.response.template.instance_variable_get('@content_for_layout')
+ controller.response.layout && controller.response.template.instance_variable_get('@cached_content_for_layout')
end
end
diff --git a/actionpack/lib/action_controller/caching/sweeping.rb b/actionpack/lib/action_controller/caching/sweeping.rb
index 61559e9ec7..c7992d7769 100644
--- a/actionpack/lib/action_controller/caching/sweeping.rb
+++ b/actionpack/lib/action_controller/caching/sweeping.rb
@@ -83,13 +83,13 @@ module ActionController #:nodoc:
controller_callback_method_name = "#{timing}_#{controller.controller_name.underscore}"
action_callback_method_name = "#{controller_callback_method_name}_#{controller.action_name}"
- send!(controller_callback_method_name) if respond_to?(controller_callback_method_name, true)
- send!(action_callback_method_name) if respond_to?(action_callback_method_name, true)
+ __send__(controller_callback_method_name) if respond_to?(controller_callback_method_name, true)
+ __send__(action_callback_method_name) if respond_to?(action_callback_method_name, true)
end
def method_missing(method, *arguments)
return if @controller.nil?
- @controller.send!(method, *arguments)
+ @controller.__send__(method, *arguments)
end
end
end