<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>15234</bug_id>
          
          <creation_ts>2011-12-16 18:18:46 +0000</creation_ts>
          <short_desc>Throw if IDBTransaction.objectStore() or IDBObjectStore.index() called after transaction finished</short_desc>
          <delta_ts>2011-12-27 22:46:25 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebAppsWG</product>
          <component>Indexed Database API</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Joshua Bell">jsbell</reporter>
          <assigned_to name="This bug has no owner yet - up for the taking">dave.null</assigned_to>
          <cc>eliotgra</cc>
    
    <cc>israelh</cc>
    
    <cc>mike</cc>
    
    <cc>public-webapps</cc>
          
          <qa_contact>public-webapps-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>61681</commentid>
    <comment_count>0</comment_count>
    <who name="Joshua Bell">jsbell</who>
    <bug_when>2011-12-16 18:18:46 +0000</bug_when>
    <thetext>The spec currently requires that IDBTransaction.objectStore() and IDBObjectStore.index() are callable after the containing transaction has finished. Since the &quot;child&quot; objects (IDBObjectStore and IDBIndex, respectively) contain references to the parent object, this complicates lifecycle management of these objects for implementations.

The implementation requirements could be simplified by specifying that these methods throw InvalidStateError once the transaction is finished. Alternately, the spec could be to throw TransactionInactiveError if the transaction is not active, much like the get() methods.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>61715</commentid>
    <comment_count>1</comment_count>
    <who name="Israel Hilerio [MSFT]">israelh</who>
    <bug_when>2011-12-17 00:26:32 +0000</bug_when>
    <thetext>Per email thread discussion, we should throw InvalidStateError for both of the APIs below.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>62064</commentid>
    <comment_count>2</comment_count>
    <who name="Eliot Graff">eliotgra</who>
    <bug_when>2011-12-27 21:35:52 +0000</bug_when>
    <thetext>Each method already currently has the following exception and description:

**InvalidStateError	

**Occurs if a request is made on a source object that has been deleted or removed.


Please let me know if I am misreading this and you&apos;re asking for something else.

Thanks,

Eliot</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>62074</commentid>
    <comment_count>3</comment_count>
    <who name="Joshua Bell">jsbell</who>
    <bug_when>2011-12-27 22:12:26 +0000</bug_when>
    <thetext>It&apos;s not clear that clause covers the case this issue is discussing. Here&apos;s a snippet:

var trans = db.transaction(&quot;store&quot;);
var store = trans.objectStore(&quot;store&quot;);
// do something useful with store
trans.oncomplete = function() {
  var store = trans.objectStore(&quot;store&quot;);
  // this issue is requesting that the above line should throw
};

In this case, it does not seem that the phrase &quot;a source object that has been deleted or removed&quot; applies.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>62075</commentid>
    <comment_count>4</comment_count>
    <who name="Eliot Graff">eliotgra</who>
    <bug_when>2011-12-27 22:16:06 +0000</bug_when>
    <thetext>How _would_ you phrase it to cover this? I am happy to make the change in the spec.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>62076</commentid>
    <comment_count>5</comment_count>
    <who name="Joshua Bell">jsbell</who>
    <bug_when>2011-12-27 22:28:12 +0000</bug_when>
    <thetext>The trivial change would be:

For IDBTransaction.objectStore(): &quot;Occurs if a request is made on a source object that has been deleted or removed, or if the transaction has finished.&quot;

For IDBObjectStore.index(): &quot;Occurs if a request is made on a source object that has been deleted or removed, or if the transaction the object store belongs to has finished.&quot;

I assume the &quot;deleted or removed&quot; phrasing - used globally in the spec - applies to cases where the IDBDatabase has been deleted or the IDBObjectStore has been deleted within a VERSION_CHANGE transaction.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>62077</commentid>
    <comment_count>6</comment_count>
    <who name="Eliot Graff">eliotgra</who>
    <bug_when>2011-12-27 22:46:25 +0000</bug_when>
    <thetext>Changes from comment 5 are in the Editor&apos;s draft.

Thanks for your help, Joshua. Have a happy new year.

Eliot</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>