diff options
author | Hemant Kumar <gethemant@gmail.com> | 2011-05-28 02:55:33 +0530 |
---|---|---|
committer | Hemant Kumar <gethemant@gmail.com> | 2011-05-28 02:57:36 +0530 |
commit | d48add714d96695a0f5d73bd50696dc26c29c794 (patch) | |
tree | 264da50c212f6a1303b2a75d214f1092417e561c /activerecord/lib/active_record | |
parent | 985ace4d7fd6a1ed4f0964c3172f1f554a88c769 (diff) | |
download | rails-d48add714d96695a0f5d73bd50696dc26c29c794.tar.gz rails-d48add714d96695a0f5d73bd50696dc26c29c794.tar.bz2 rails-d48add714d96695a0f5d73bd50696dc26c29c794.zip |
close statment only if its not closed
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb b/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb index 8e7c936bf8..ee138236c8 100644 --- a/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb @@ -102,7 +102,7 @@ module ActiveRecord # Clears the prepared statements cache. def clear_cache! - @statements.values.each { |hash| hash[:stmt].close } + @statements.values.each { |hash| !hash[:stmt].closed? && hash[:stmt].close } @statements.clear end |