Browse Source

Turn on sqlite thread safety checks -- serializer should fully protect it

tags/nilmdb-1.2
Jim Paris 11 years ago
parent
commit
0dcdec5949
1 changed files with 1 additions and 6 deletions
  1. +1
    -6
      nilmdb/server/nilmdb.py

+ 1
- 6
nilmdb/server/nilmdb.py View File

@@ -97,12 +97,7 @@ class NilmDB(object):

# SQLite database too
sqlfilename = os.path.join(self.basepath, "data.sql")
# We use check_same_thread = False, assuming that the rest
# of the code (e.g. Server) will be smart and not access this
# database from multiple threads simultaneously. Otherwise
# false positives will occur when the database is only opened
# in one thread, and only accessed in another.
self.con = sqlite3.connect(sqlfilename, check_same_thread = False)
self.con = sqlite3.connect(sqlfilename, check_same_thread = True)
self._sql_schema_update()

# See big comment at top about the performance implications of this


Loading…
Cancel
Save