class ActiveRecord::ConnectionAdapters::StatementPool
:nodoc:
def [](key)
def [](key) cache[key] end
def []=(sql, stmt)
def []=(sql, stmt) while @statement_limit <= cache.size dealloc(cache.shift.last) end cache[sql] = stmt end
def cache
def cache @cache[Process.pid] end
def clear
def clear cache.each_value do |stmt| dealloc stmt end cache.clear end
def dealloc(stmt)
def dealloc(stmt) raise NotImplementedError end
def delete(key)
def delete(key) dealloc cache[key] cache.delete(key) end
def each(&block)
def each(&block) cache.each(&block) end
def initialize(statement_limit = nil)
def initialize(statement_limit = nil) @cache = Hash.new { |h, pid| h[pid] = {} } @statement_limit = statement_limit || DEFAULT_STATEMENT_LIMIT end
def key?(key)
def key?(key) cache.key?(key) end
def length
def length cache.length end