Quantcast
Channel: Active questions tagged javascript - Stack Overflow
Viewing all articles
Browse latest Browse all 140762

Transaction in IndexDB does not start immediately if called after one already completed

$
0
0

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


Viewing all articles
Browse latest Browse all 140762

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>