MCPcopy Create free account
hub / github.com/M66B/FairEmail / endTransaction

Method endTransaction

app/src/main/java/eu/faircode/email/DB.java:3237–3284  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3235 }
3236
3237 @Override
3238 @SuppressWarnings("deprecation")
3239 public void endTransaction() {
3240 try {
3241 super.endTransaction();
3242 } catch (Throwable ex) {
3243 String msg = ex.getMessage();
3244 if (TextUtils.isEmpty(msg))
3245 throw ex;
3246
3247 if (msg.contains("no current transaction")) {
3248 // java.lang.IllegalStateException: Cannot perform this operation because there is no current transaction.
3249 Log.w(ex);
3250 return;
3251 }
3252
3253 if (msg.contains("no transaction is active")) {
3254 // Moto e⁶ plus - Android 9
3255 /*
3256 android.database.sqlite.SQLiteException: cannot rollback - no transaction is active (code 1 SQLITE_ERROR)
3257 at android.database.sqlite.SQLiteConnection.nativeExecute(SQLiteConnection.java:-2)
3258 at android.database.sqlite.SQLiteConnection.execute(SQLiteConnection.java:569)
3259 at android.database.sqlite.SQLiteSession.endTransactionUnchecked(SQLiteSession.java:439)
3260 at android.database.sqlite.SQLiteSession.endTransaction(SQLiteSession.java:401)
3261 at android.database.sqlite.SQLiteDatabase.endTransaction(SQLiteDatabase.java:566)
3262 at androidx.sqlite.db.framework.FrameworkSQLiteDatabase.endTransaction(FrameworkSQLiteDatabase:75)
3263 at androidx.room.RoomDatabase.internalEndTransaction(RoomDatabase:594)
3264 at androidx.room.RoomDatabase.endTransaction(RoomDatabase:584)
3265 at eu.faircode.email.DB.endTransaction(DB:2842)
3266 at androidx.room.paging.LimitOffsetDataSource.loadInitial(LimitOffsetDataSource:181)
3267 at androidx.paging.PositionalDataSource.dispatchLoadInitial(PositionalDataSource:286)
3268 at androidx.paging.TiledPagedList.<init>(TiledPagedList:107)
3269 at androidx.paging.PagedList.create(PagedList:229)
3270 at androidx.paging.PagedList$Builder.build(PagedList:388)
3271 at androidx.paging.LivePagedListBuilder$1.compute(LivePagedListBuilder:206)
3272 at androidx.paging.LivePagedListBuilder$1.compute(LivePagedListBuilder:171)
3273 at androidx.lifecycle.ComputableLiveData$2.run(ComputableLiveData:110)
3274 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
3275 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
3276 at java.lang.Thread.run(Thread.java:764)
3277 */
3278 Log.w(ex);
3279 return;
3280 }
3281
3282 throw ex;
3283 }
3284 }
3285
3286 public static class Converters {
3287 @TypeConverter

Callers 15

delegateMethod · 0.95
fetchMethod · 0.95
optimizeAccountMethod · 0.95
cleanupMethod · 0.95
onExecuteMethod · 0.95
onExecuteMethod · 0.95
onSyncMethod · 0.95
onSendMethod · 0.95
onRestoreMethod · 0.95
onExecuteMethod · 0.95
onExecuteMethod · 0.95
onExecuteMethod · 0.95

Calls 4

wMethod · 0.95
getMessageMethod · 0.65
isEmptyMethod · 0.45
containsMethod · 0.45

Tested by

no test coverage detected