Removed transaction from search

This commit is contained in:
M66B 2021-02-28 16:48:51 +01:00
parent 6d196e8839
commit 14389f9efa
1 changed files with 92 additions and 109 deletions

View File

@ -141,6 +141,8 @@ public class BoundaryCallbackMessages extends PagedList.BoundaryCallback<TupleMe
executor.submit(new Runnable() {
@Override
public void run() {
Log.i("Boundary run");
int found = 0;
try {
if (state.destroyed || state.error)
@ -228,9 +230,6 @@ public class BoundaryCallbackMessages extends PagedList.BoundaryCallback<TupleMe
return found;
}
try {
db.beginTransaction();
while (found < pageSize && !state.destroyed) {
if (state.matches == null ||
(state.matches.size() > 0 && state.index >= state.matches.size())) {
@ -295,14 +294,6 @@ public class BoundaryCallbackMessages extends PagedList.BoundaryCallback<TupleMe
}
}
db.setTransactionSuccessful();
if (found == pageSize)
return found;
} finally {
db.endTransaction();
}
Log.i("Boundary device done");
return found;
}
@ -491,9 +482,6 @@ public class BoundaryCallbackMessages extends PagedList.BoundaryCallback<TupleMe
state.ifolder.fetch(add.toArray(new Message[0]), fp);
}
try {
db.beginTransaction();
Core.State astate = new Core.State(ConnectionHelper.getNetworkState(context));
for (int j = isub.length - 1; j >= 0 && found < pageSize && !state.destroyed && astate.isRecoverable(); j--)
try {
@ -526,11 +514,6 @@ public class BoundaryCallbackMessages extends PagedList.BoundaryCallback<TupleMe
} finally {
((IMAPMessage) isub[j]).invalidateHeaders();
}
db.setTransactionSuccessful();
} finally {
db.endTransaction();
}
}
if (state.index < 0) {