1
0
Fork 0
mirror of https://github.com/geometer/FBReaderJ.git synced 2025-10-04 18:29:23 +02:00

fixed several exceptions

This commit is contained in:
Nikolay Pultsin 2011-07-23 02:56:55 +01:00
parent 334a3a1871
commit b924f869ce
5 changed files with 51 additions and 36 deletions

View file

@ -50,12 +50,13 @@ public final class SQLiteBooksDatabase extends BooksDatabase {
}
protected void executeAsATransaction(Runnable actions) {
myDatabase.beginTransactionNonExclusive();
myDatabase.execSQL("BEGIN IMMEDIATE");
try {
actions.run();
myDatabase.setTransactionSuccessful();
} catch (Throwable t) {
myDatabase.execSQL("ROLLBACK");
} finally {
myDatabase.endTransaction();
myDatabase.execSQL("END");
}
}