- From: Jack Works <notifications@github.com>
- Date: Wed, 18 Dec 2019 02:02:06 -0800
- To: w3c/IndexedDB <IndexedDB@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Wednesday, 18 December 2019 10:02:09 UTC
By adding a `onbeforecommit` event, developers can suppress the bad transaction that make the db in an inconsistent state to be committed.
e.g.
```ts
transaction.onbeforecommit = (event) => {
// when the transaction enter the `onbeforecommit` event, it becomes readonly. it should be enough for consistency check
if (dbIsConsistent(transaction)) { event.commit() }
else { event.abort() } // db is inconsistent if we commit this transaction
}
```
--
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/314
Received on Wednesday, 18 December 2019 10:02:09 UTC