IDBWrapper: Failed to execute 'transaction' on ' IDBDatabase': The database connection is closing
In Chrome sometimes the following error appears:
Failed to execute 'transaction' on ' IDBDatabase': The database connection is closing
Sadly to this point I can not say in which line of code because it is hard to reproduce this.
About this issue
- Original URL
- State: open
- Created 7 years ago
- Reactions: 18
- Comments: 18 (4 by maintainers)
‘POSTS’ to ‘posts’
Hi,
Glad I found that thread since we are running into that issue. We put a good amount of analysis and tracking on this - some of our numbers are in this spreadsheet - and these are our findings:
I will check out the recommendations for fixes above and report back.
Any ideas of anyone needs more data feel free to hit me up.
R.
Same thing is keep happening to me. when you will try to access the indexDb store before it gets ready this error will arise.
Some browser might tend to loose connection every [I don’t know] seconds/minutes/hours.
The solution is to reload the connection, I do it every 10 minutes:
I also had this problem. Some customers reported that this error occurred after the computer resume from hibernation Electron 9.1.2. But I didn’t find any useful information, I sure that my program does not close the database connection
Just stumbled over this thread: I have the same problem in Safari 12.0.1 (13606.2.104.1.2) and Chrome (Version 70.0.3538.102 (Offizieller Build) (64-Bit) - both Mac: [Error] Unhandled Promise Rejection: InvalidStateError: Failed to execute ‘transaction’ on ‘IDBDatabase’: The database connection is closing.
I got the error when recreating/reopening the IDB.
I am explicitly closing/droping the indexedDB when the user logs out and got this error message when the user logs in (where the DB will be recreated/opened). Even the error message shows up I can access the IDB after recreation. This is the code on logout (no error message on this):
`function dbDrop() {
}`
Firefox (Mac) is the only browser that doesn’t show the message above on re-login.