Re: [IndexedDB] Consider adding a completion event or callback to the IDBDatabase.close() operation (#72)

>As long as you keeping making requests the transaction won't try and commit. The implementation would know that no further transactions can be started, but no idea when any outstanding ones would complete.

Based on simple logical reasoning: if all connections are at the `pendingClose` state then it logically sound to assert that all new transactions for that particular database would be rejected. Thus the wait time after `blocked` would be finite. Unless of course I'm missing something here again..?

>FWIW, you can't directly cancel an open request; the closest you can get is to abort the transaction in the "upgradeneeded" handler and/or close the connection immediately in the "success" handler.

It seemed reasonable it could also be aborted it at "blocked"? why not actually? Anyway,  this just makes it a bit more cumbersome for the developer who wants to "cleanly" handle this.

I scanned through the documentation and there are several things mentioned here I haven't found at this point:
1. How to actually cancel an `open` request? I assumed I knew how but now I realize I don't really?
2. What exact event is triggered in chrome to signal on abrupt closing of the database (due to corruption, etc?) or is it just an error that appears when you try to start a transaction or open it?

There is one more thing I wanted to clarify about the fatal `blocked` errors I was getting on IE11: they happen in a perfectly controlled environment - all transactions are strictly sequential and every request is waited to completion or otherwise the whole sequence breaks. I still need to investigate that a bit more. This was also a part of the reason I mentioned aborting at the `blocked` event and retrying - because in this kind of pathological situations (software bugs or out-of-spec behavior) it seems like that would be the only thing to do.. (I mean the `upgradeneeded` event wouldn't even get triggered..)

---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/IndexedDB/issues/72#issuecomment-199703654

Received on Tuesday, 22 March 2016 08:45:46 UTC