Re: [w3c/IndexedDB] Specify timing of transaction deactivation more precisely (#87)

Here is the example results differently in FF & Chrome:
https://jsfiddle.net/ebe265f5/2/
```javascript
  let request = indexedDB.open("Transaction Life Cycle");
  request.onupgradeneeded = function(event) {
    let db = event.target.result;
    db.createObjectStore("store", {autoIncrement: true});
  };
  
  request.onsuccess = function(event) {
 let db = event.target.result;
    let objectStore = db.transaction("store", "readwrite").objectStore("store");
    let request = objectStore.add({id: 1});
    let txn;
    request.addEventListener("success", function(event) {
      console.log("1st listener");
      txn = db.transaction("store", "readwrite");
    });
    request.addEventListener("success", function(event) {
      console.log("2st listener");
      let objectStore = txn.objectStore("store");
      objectStore.add({id: 2}).onsuccess = function(event) {
        console.log("2nd object is added");
      };
    });
  }
```
In http://w3c.github.io/IndexedDB/#dom-idbdatabase-transaction
If "8. When control is returned to the event loop, the implementation must unset the active flag." means the control is return at the end of the task, then 2nd object could should be added.
However, in Chrome, this is not expected.

@inexorabletash Can this be specified more clearly when then active flag shall be unset? and what's the expected behavior in this case?

-- 
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/87#issuecomment-269620134

Received on Thursday, 29 December 2016 11:56:10 UTC