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:
parent
334a3a1871
commit
b924f869ce
5 changed files with 51 additions and 36 deletions
|
@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue