Run post transaction tasks only after root transaction ends.

This commit is contained in:
Clark
2023-05-22 17:16:38 -04:00
committed by Nicholas
parent 61f50cfe60
commit 4a9a07a9ef
3 changed files with 50 additions and 6 deletions

View File

@@ -313,12 +313,13 @@ public class SQLiteDatabase implements SupportSQLiteDatabase {
public void endTransaction() {
trace("endTransaction()", wrapped::endTransaction);
traceLockEnd();
Set<Runnable> tasks = getPostSuccessfulTransactionTasks();
for (Runnable r : new HashSet<>(tasks)) {
r.run();
if (!wrapped.inTransaction()) {
Set<Runnable> tasks = getPostSuccessfulTransactionTasks();
for (Runnable r : new HashSet<>(tasks)) {
r.run();
}
tasks.clear();
}
tasks.clear();
}
public void setTransactionSuccessful() {