Re: [IndexedDB] Re: onsuccess callback in race condition?

The example in introdution section looks good.

I quoted from section 3.2.2 The INBRequest Interface.

Example
In the following example, we open a database asynchronously. Various event handlers are registered for responding to various situations.

ECMAScript
indexedDB.request.onsuccess = function(evt) {...};
indexedDB.request.onerror = function(evt) {...};
indexedDB.open('AddressBook', 'Address Book');

Maybe this needs to be updated?



On 7/15/10 3:18 PM, "ext Jeremy Orlow" <jorlow@chromium.org> wrote:

On Thu, Jul 15, 2010 at 8:16 PM,  <victor.hong@nokia.com> wrote:



On 7/15/10 1:13 PM, "ext Jeremy Orlow" <jorlow@chromium.org> wrote:

> On Thu, Jul 15, 2010 at 6:04 PM,  <victor.hong@nokia.com> wrote:
>>
>> Hi Jeremy,
>>
>> Thank you for responding. If I understand you correctly, the example 1 could
>> produce a race condition,
>
> I don't see how.  onsuccess is always set immediately after the request object
> is created by the asynchronous call.
>
>> and example 2 will not.
>
> This example is completely outdated and will not work period.  Please take a
> look at the latest editors draft.  (A lot of the async changes were just
> committed.)
>

I was quoting from this draft (July 15 2010)
http://dvcs.w3.org/hg/IndexedDB/raw-file/tip/Overview.html

Is it outdated already?
And where do I go for the latest?

The example was fixed a couple hours after your initial message.  :-)


- Victor

Received on Thursday, 15 July 2010 19:28:17 UTC