Commit f25406b8 authored by Max Lv's avatar Max Lv

Protect table creation with transaction

parent 2c871816
...@@ -141,7 +141,9 @@ class DBHelper(val context: Context) ...@@ -141,7 +141,9 @@ class DBHelper(val context: Context)
} }
if (oldVersion < 23) { if (oldVersion < 23) {
profileDao.executeRawNoArgs("BEGIN TRANSACTION;")
TableUtils.createTable(connectionSource, classOf[KeyValuePair]) TableUtils.createTable(connectionSource, classOf[KeyValuePair])
profileDao.executeRawNoArgs("COMMIT;")
import KeyValuePair._ import KeyValuePair._
val old = PreferenceManager.getDefaultSharedPreferences(app) val old = PreferenceManager.getDefaultSharedPreferences(app)
kvPairDao.createOrUpdate(new KeyValuePair(Key.id, TYPE_INT, kvPairDao.createOrUpdate(new KeyValuePair(Key.id, TYPE_INT,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment