question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

DB connection fails to close

See original GitHub issue

I’m using fakeIndexedDB for testing. I am unable to close db connections after calling db.close(). I set an onClose event listener to indicate when the db closes but it never fires. I need to upgrade the db in one of my tests, I can’t do this with other connections open. So, I set the db to close onversionchange but alas, the db doesn’t close and upgrade request is blocked.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:6

github_iconTop GitHub Comments

2reactions
Quelklefcommented, Jun 10, 2020

Actually, this doesn’t seem to be a bug at all. According to MDN, onclose only fires on unexpected closes.

It sounds like your original use case is for upgrading a db when other connections are open. I believe what you want is onversionchange, which fires “when a database structure change […] was requested elsewhere”

0reactions
Quelklefcommented, Jun 11, 2020

got it 👍 👌

Read more comments on GitHub >

github_iconTop Results From Across the Web

vb.net - Database Connection Close Error - Stack Overflow
1 Answer 1 · 1) I concur that your connection object needs to be LOCAL to the method. · 2) Somewhere along VS...
Read more >
How to deal with closed connections in database pool
Such closed connections (commonly known as "infected" connections) may be caused by the database, which closes a connection due to a "idle connection...
Read more >
Handling java.sql.SQLRecoverableException: Closed ...
This error message indicates that the connection used by the backup task (or any other long-running operation that relies on a single database ......
Read more >
Problem : can't close a database connection — oracle-tech
Hi, I'am using connection pool under weblogic 6 and I can't close the connection when a SQL exception occures. The connection always stay ......
Read more >
How costly is opening and closing of a DB connection?
The max value for it is 100. When client closes connection, it is returned to the cache. When a new connection opens, it...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found