Fix runPostSuccessfulTransaction behavior.

This commit is contained in:
Greyson Parrelli
2024-06-03 10:27:53 -04:00
committed by Cody Henthorne
parent 164f089d37
commit c3ab8dddd0

View File

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