Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

interrupte in chrome #47

Open
kiyaL opened this issue Jul 8, 2013 · 1 comment
Open

interrupte in chrome #47

kiyaL opened this issue Jul 8, 2013 · 1 comment

Comments

@kiyaL
Copy link

kiyaL commented Jul 8, 2013

Browser: 27.0.1453.116

Code:

batchAdd: function(tableName, items, i, success, failure) {
                var that = this;
                var objectStore = $.indexedDB(constants.DbName).objectStore(tableName);
                if(items.length > i) {
                    objectStore.add(items[i]).done(function() {
                        console.log("batchAdd success");
                        that.batchAdd(tableName, items, ++i, success, failure);
                    }).fail(function() {
                        console.log("batchAdd error");
                        if(!!failure){
                            failure();
                        }
                    });
                } else {
                    if(!!success){
                        success(items);
                    }
                }
            },

openDatabase: function(success, failure) {
                $.indexedDB(constants.DbName).done(function() {
                    console.log("openDatabase success");
                    if(!!success){
                        success();
                    }
                }).fail(function() {
                    console.log("openDatabase error");
                    if(!!failure){
                        failure();
                    }
                });
            },

deleteDatabase: function(success, failure) {
                $.indexedDB(constants.DbName).deleteDatabase().done(function() {
                    console.log("deleteDatabase success");
                    if(!!success){
                        success();
                    }
                }).fail(function() {
                    console.log("deleteDatabase error");
                    if(!!failure){
                        failure();
                    }
                }).progress(function(){
                    console.log("deleteDatabase progress");
                });
            }

I call batchAdd to add 10000 items and refresh browser when batchAdd haven’t completed. batchAdd process is interrupted. Then I find I can't operation the database any more. Such as deleteDatabase and openDatabase have no response.

But firefox 22.0 works fine.

I don‘t know if my code is correct or it is bug in jquery-indexeddb. Is there any way to fix this issue? thanks.

@kiyaL
Copy link
Author

kiyaL commented Jul 8, 2013

In additional, it works fine after I manually delete the folder C:\Documents and Settings\Administrator\Local Settings\Application Data\Google\Chrome\User Data\Default\IndexedDB\http_localhost_8080.indexeddb.leveldb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant