diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2011-09-06 16:47:34 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2011-09-06 16:47:34 -0700 |
commit | 54b7e783ef202d022a57dcdd54f7edf021c1df78 (patch) | |
tree | b422ab3d93685c806f3b1405ffdf410c9d5b8dd4 /activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb | |
parent | a4fa6eab396e703eb70b70ed708220a6405f2899 (diff) | |
download | rails-54b7e783ef202d022a57dcdd54f7edf021c1df78.tar.gz rails-54b7e783ef202d022a57dcdd54f7edf021c1df78.tar.bz2 rails-54b7e783ef202d022a57dcdd54f7edf021c1df78.zip |
Database adapters use a statement pool.
Database adapters use a statement pool for limiting the number of open
prepared statments on the database. The limit defaults to 1000, but can
be adjusted in your database config by changing 'statement_limit'.
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb b/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb index a4e21b714b..7c7e762c19 100644 --- a/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb @@ -50,7 +50,7 @@ module ActiveRecord end class StatementPool < ConnectionAdapters::StatementPool - def initialize(connection, max = 1000) + def initialize(connection, max) super @cache = {} end @@ -82,7 +82,8 @@ module ActiveRecord def initialize(connection, logger, config) super(connection, logger) - @statements = StatementPool.new(@connection) + @statements = StatementPool.new(@connection, + config.fetch(:statement_limit) { 1000 }) @config = config end |