This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 11280 - IDBFactory.databases doesn't work
Summary: IDBFactory.databases doesn't work
Status: RESOLVED FIXED
Alias: None
Product: WebAppsWG
Classification: Unclassified
Component: Indexed Database API (show other bugs)
Version: unspecified
Hardware: PC All
: P2 normal
Target Milestone: ---
Assignee: This bug has no owner yet - up for the taking
QA Contact: public-webapps-bugzilla
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-09 22:49 UTC by Jonas Sicking (Not reading bugmail)
Modified: 2010-11-12 19:16 UTC (History)
3 users (show)

See Also:


Attachments

Description Jonas Sicking (Not reading bugmail) 2010-11-09 22:49:44 UTC
I've somehow missed this until now, but apparently IDBFactory has a .databases property.

While I could see the use for this, it can't be implemented in a non-racy way. The problem is that other processes or threads can create and delete databases at any time, so there is no way to guarantee that a database which existed when .databases is checked, will exist a few milliseconds later when the knowledge of a database's existence is used. For example

if (indexedDB.databases.contains("hello")) {
  indexedDB.open("hello").onsuccess = ...;
}

has a race condition.

Another problem is that it can't be implemented without blocking the main thread while going off to another thread or process where the indexedDB implementation lives. It'll likely also require synchronous IO to get the list of databases from file.

I suggest we simply remove it for now.
Comment 1 Jonas Sicking (Not reading bugmail) 2010-11-12 19:16:51 UTC
Removed http://dvcs.w3.org/hg/IndexedDB/rev/148857621627