aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJamis Buck <jamis@37signals.com>2007-01-22 23:07:54 +0000
committerJamis Buck <jamis@37signals.com>2007-01-22 23:07:54 +0000
commit7359dc0028b87f948d188f5fa6bb366a49181a81 (patch)
tree6577d17ddcbc1ae1c4788f227587c8ac782439b0
parent1e9ce3c6a123baf773c89ef2324e9f3d17e2be52 (diff)
downloadrails-7359dc0028b87f948d188f5fa6bb366a49181a81.tar.gz
rails-7359dc0028b87f948d188f5fa6bb366a49181a81.tar.bz2
rails-7359dc0028b87f948d188f5fa6bb366a49181a81.zip
Make sure sqlite3 driver closes open connections on disconnect (closes #7105)
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6012 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
-rw-r--r--activerecord/CHANGELOG2
-rw-r--r--activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb5
2 files changed, 7 insertions, 0 deletions
diff --git a/activerecord/CHANGELOG b/activerecord/CHANGELOG
index ef2263a855..de3a777920 100644
--- a/activerecord/CHANGELOG
+++ b/activerecord/CHANGELOG
@@ -1,5 +1,7 @@
*SVN*
+* Make sure sqlite3 driver closes open connections on disconnect [Rob Rasmussen]
+
* [DOC] clear up some ambiguity with the way has_and_belongs_to_many creates the default join table name. #7072 [jeremymcanally]
* change_column accepts :default => nil. Skip column options for primary keys. #6956, #7048 [dcmanges, Jeremy Kemper]
diff --git a/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb b/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb
index 57520ea249..199f53b8a7 100644
--- a/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb
+++ b/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb
@@ -105,6 +105,11 @@ module ActiveRecord
def requires_reloading?
true
end
+
+ def disconnect!
+ super
+ @connection.close rescue nil
+ end
def supports_count_distinct? #:nodoc:
sqlite_version >= '3.2.6'