You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I get the following error after I have done around 400 calls to indexedDB.open() in safari: (14 unable to open database file). After some googling I found this blogpost, http://zacster.blogspot.se/2015/10/safari-web-sql-14-unable-to-open.html, which says that safari doesn't garbage collect db handles from openDatabas calls.
The solution I'm currently using is to cache open databases in an object and reuse that connection. This is how the openDB(oldVersion) method at line 366 looks for me now.
After some testing I discovered a new problem I think is related to my suggested solution. When my app has been running for a while, new transactions will fail with the error message: "database has been closed". I haven't found any really good way to see if the database has been closed or not without creating a transaction which will call the error callback.
My very ugly solution to this at the moment is to reuase the connections but before each transaction make a dummy transaction that checks that the database is open. If not I reopen the database again
Recent code (including the latest 3.0.0 RCs) included such caching. Feel free to give it a shot. Closing, but feel free to report if you experience any difficulties.
I get the following error after I have done around 400 calls to indexedDB.open() in safari: (14 unable to open database file). After some googling I found this blogpost, http://zacster.blogspot.se/2015/10/safari-web-sql-14-unable-to-open.html, which says that safari doesn't garbage collect db handles from openDatabas calls.
The solution I'm currently using is to cache open databases in an object and reuse that connection. This is how the openDB(oldVersion) method at line 366 looks for me now.
Do you think this is a solid solution? If so I'm happy to make a PR.
The text was updated successfully, but these errors were encountered: