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

Issue with promises: "A request was placed against a transaction which is currently not active, or which is finished." #70

Closed
ebryn opened this issue Jul 17, 2013 · 8 comments

Comments

@ebryn
Copy link

ebryn commented Jul 17, 2013

I'm working on a library to wrap IndexedDB with a promise-aware API: https://github.com/ebryn/EasyIndexedDB. I am running into an issue with IndexedDBShim transactions giving me the error: "A request was placed against a transaction which is currently not active, or which is finished." You can see this issue here: http://erikbryn.com/bugs-reports/IndexedDBShim/EasyIndexedDB/test/index.html

From my research, it seems this may be related to assumptions being made inside IndexedDBShim about user code executing within a single event loop of the browser. I noticed that transactions seem to be using setTimeout to schedule themselves to execute on next tick, but the promise library I'm using, RSVP, ensures that promises will resolve asynchronously as well.

@axemclion
Copy link
Collaborator

@ebryn I had to do the setTimeout trick coz of the way transactions were specified - some transactions like versionChange, where I create an objectStore is async - I did not want the transaction to finish before the next request is placed there - hence the queue mechanism.

This has been a source of a lot of inconsistancies, and I plan to rewrite that piece soon.

@ebryn
Copy link
Author

ebryn commented Jul 18, 2013

How soon? This is something I would like to have a solution for in the next week. I'd be happy to help with the rewrite.

@ebryn
Copy link
Author

ebryn commented Jul 22, 2013

Ping

@axemclion
Copy link
Collaborator

@ebryn Sorry for not getting back - was at phonegap day last weekend. Will look at it today, and tell you how much time I can spend. We could see if we can also break up the work and spend some time.

@taras
Copy link

taras commented Oct 4, 2013

@axemclion I would like to use EasyIndexedDB which relies on your IndexedDBShim for browser compatibility. Any idea when you'd have a chance to address this issue?

@axemclion
Copy link
Collaborator

@taras Sorry for the delay. I have been really busy on this other project - http://github.com/axemclion/grunt-telementry. I was hoping that mobile browsers soon start supporting this with their new releases, but looks like that aint happening. Also, a lot of people have asked for this, so I should start working on this soon .

@taras
Copy link

taras commented Oct 6, 2013

@axemclion I know how hard it can be to switch from one project to another, especially when the other project is not as immediately relevant to what you're doing at the moment. I appreciate the effort that you put into the library and hope you'll find time to continue with it. It would be great to get this sorted out then we can use IndexedDB across all browsers.

What are the changes that you'd be able look into this in the near future?

@JamesMessinger
Copy link
Collaborator

This issue has been fixed in the latest version. Please give it a try and let us know if there are any problems. Thanks!

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

4 participants