Since today I’ve started getting errors when I try to delete IndexedDB database in Google Chrome version 21.
When i run the command for deleting database:
window.webkitIndexedDB.deleteDatabase(dbName);
The following event fires:
IDBVersionChangeEvent
bubbles: false
cancelBubble: false
cancelable: false
clipboardData: undefined
currentTarget: IDBVersionChangeReques
defaultPrevented: false
eventPhase: 2
returnValue: true
srcElement: IDBVersionChangeRequest
target: IDBVersionChangeRequest
timeStamp: 1343929274696
type: "blocked"
version: ""
Additional info: I am accessing the IndexedDB from web workers and from window.
The problem was in the accessing the database from the web workers. In this line of code:
There is probably some bug in Google chrome if database closing needs more time than usual and you close the web worker, then the database is locked when you try to delete it afterwards.
I’ve fixed the problem by not closing the web worker and let it stay in idle mode.