diff options
| author | Robin Munn <robin.munn@gmail.com> | 2006-09-05 15:51:14 +0000 |
|---|---|---|
| committer | Robin Munn <robin.munn@gmail.com> | 2006-09-05 15:51:14 +0000 |
| commit | 70e05817910d5fe757a3a235252ef7c12e058676 (patch) | |
| tree | 98583716fe36100c8b9e82e31325993d3b4f382b /django/db/backends/sqlite3/base.py | |
| parent | 083ebb346844ece29d81bacdd5ec6574feae3896 (diff) | |
sqlalchemy: Merged revisions 3679 to 3723 from trunk.
git-svn-id: http://code.djangoproject.com/svn/django/branches/sqlalchemy@3724 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/db/backends/sqlite3/base.py')
| -rw-r--r-- | django/db/backends/sqlite3/base.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/django/db/backends/sqlite3/base.py b/django/db/backends/sqlite3/base.py index 68452e1363..a3e8f0d584 100644 --- a/django/db/backends/sqlite3/base.py +++ b/django/db/backends/sqlite3/base.py @@ -62,7 +62,10 @@ class DatabaseWrapper(local): self.connection.rollback() def close(self): - if self.connection is not None: + from django.conf import settings + # If database is in memory, closing the connection destroys the database. + # To prevent accidental data loss, ignore close requests on an in-memory db. + if self.connection is not None and settings.DATABASE_NAME != ":memory:": self.connection.close() self.connection = None |
