I'm using dexiejs to insert data in a Indexdb table(about 10k records).
After the rw transaction is completed, which I am checking with the following methods:
try {
await QDB.transaction("rw", table1, table1, async tx => {
//ALSO CHECK TX
tx.on("complete", () => console.log("COMPLETED"));
//here goes the bulkadd code ...
});
console.log("COMPLETED");
} catch (e) {
console.log(e);
}
So after the above is completed, I then try to execute another transaction that modifies only certain records, but it takes about 20s before this last transaction even starts.
I even traced the whole process inside the chrome profiler and the browser seems relatively at ease for those 20s before the last transaction starts.
Why is that?
Thanks in advance
copying comment:
I solved it by using only one transaction. The source of the problem though was that I was using nested async function with await Dexie.waitFor(). I think that using nested promises inside waitFor causes the inner promises to be called with some delay