Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions core/src/main/java/io/snabble/sdk/ProductDatabase.java
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,7 @@ synchronized void applyDeltaUpdate(InputStream inputStream) throws IOException {
tempDb.beginTransaction();
} catch (SQLiteException e) {
project.logErrorEvent("Could not apply delta update: Could not access temp database");
tempDb.close();
throw new IOException();
}

Expand Down Expand Up @@ -390,6 +391,7 @@ synchronized void applyDeltaUpdate(InputStream inputStream) throws IOException {
tempDb.endTransaction();
} catch (SQLiteException e) {
project.logErrorEvent("Could not apply delta update: Could not finish transaction on temp database");
tempDb.close();
throw new IOException();
}

Expand All @@ -400,6 +402,7 @@ synchronized void applyDeltaUpdate(InputStream inputStream) throws IOException {
tempDb.execSQL("VACUUM");
} catch (SQLiteException e) {
project.logErrorEvent("Could not apply delta update: %s", e.getMessage());
tempDb.close();
deleteDatabase(tempDbFile);
throw new IOException();
}
Expand All @@ -413,6 +416,7 @@ synchronized void applyDeltaUpdate(InputStream inputStream) throws IOException {
swap(tempDbFile);
} catch (IOException e) {
project.logErrorEvent("Could not apply delta update: %s", e.getMessage());
tempDb.close();
throw new IOException();
}

Expand Down