-
Notifications
You must be signed in to change notification settings - Fork 49
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
'IDBObjectStore': The transaction has finished. #12
Comments
Hey @Lunatic83 , this is not really an issue with the library. The problem here is that you are opening an XHR within your transaction. That's not going to work given the async nature of javascript based promises. You also cannot both error and attempt to insert something in your transaction. If your transaction results in error, your transaction will be rolled back. My recommended refactoring..(
|
I'm going to close this issue though as it's not really a bug persay. It would also be excellent if you could open & place your questions into stackoverflow and tag it "angular-indexed-db". That sort of method of first asking stack overflow questions seems most helpful to others who run into the same problems. Let me know when you open a question there and I am happy to direct you to a better solution. |
Huhz On Friday, November 21, 2014, Bram Whillock notifications@github.com
|
Hi bramski,
I'm opening another issue, because I tryed to develope another way to solve the issue #11, using Restangular, I would fetch my api entity if is not stored inside indexedDB store.
$indexedDB.openStore(entityName, function(table) {
var d = $q.defer();
var promise = d.promise;
}, 'readwrite');
I have Error: Failed to execute 'add' on 'IDBObjectStore': The transaction has finished.
I understand the reason for async callback for restangular refers to table after the transaction is closed, is there any way to keep the transaction open and manage it inside restangular callback?
Thanks a lot for your support.
G
The text was updated successfully, but these errors were encountered: