ArmandasRokas / beeware

0 stars 0 forks source link

SQLiteConstraintException #91

Closed ArmandasRokas closed 4 years ago

ArmandasRokas commented 4 years ago
2020-07-30 08:39:22.252 1192-1274/dk.dtu.group22.beeware E/SQLiteDatabase: Error inserting hive_hum=69.2 hive_temp_c_in=35.0 timestamp=1592431801000 hive_illum=0.0 hive_weight_kgs=38.81 hive_id=240
    android.database.sqlite.SQLiteConstraintException: UNIQUE constraint failed: HIVE_MEASUREMENT.hive_id, HIVE_MEASUREMENT.timestamp (code 1555)
        at android.database.sqlite.SQLiteConnection.nativeExecuteForLastInsertedRowId(Native Method)
        at android.database.sqlite.SQLiteConnection.executeForLastInsertedRowId(SQLiteConnection.java:782)
        at android.database.sqlite.SQLiteSession.executeForLastInsertedRowId(SQLiteSession.java:788)
        at android.database.sqlite.SQLiteStatement.executeInsert(SQLiteStatement.java:86)
        at android.database.sqlite.SQLiteDatabase.insertWithOnConflict(SQLiteDatabase.java:1474)
        at android.database.sqlite.SQLiteDatabase.insert(SQLiteDatabase.java:1343)
        at dk.dtu.group22.beeware.dal.dao.implementation.CachedHiveRepoSQLImpl.insertHiveMeasurements(CachedHiveRepoSQLImpl.java:130)
        at dk.dtu.group22.beeware.dal.dao.implementation.CachedHiveRepoSQLImpl.updateHive(CachedHiveRepoSQLImpl.java:142)
        at dk.dtu.group22.beeware.dal.dao.implementation.CachingManager.updateHive(CachingManager.java:131)
        at dk.dtu.group22.beeware.dal.dao.implementation.CachingManager.getCachedHiveAndUpdateOrCreateUsesNetwork(CachingManager.java:87)
        at dk.dtu.group22.beeware.business.implementation.Logic.getHiveNetworkAndSetCurrValues(Logic.java:196)
        at dk.dtu.group22.beeware.business.implementation.GraphViewModel.downloadOldDataInBackground(GraphViewModel.java:110)
        at dk.dtu.group22.beeware.presentation.Graph$DownloadBGHiveAsyncTask.doInBackground(Graph.java:759)
        at dk.dtu.group22.beeware.presentation.Graph$DownloadBGHiveAsyncTask.doInBackground(Graph.java:748)
        at android.os.AsyncTask$2.call(AsyncTask.java:305)
        at java.util.concurrent.FutureTask.run(FutureTask.java:237)
        at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:243)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
        at java.lang.Thread.run(Thread.java:761)
ArmandasRokas commented 4 years ago

Should I do something with that?