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.

Connection is not been closed

See original GitHub issue

Hi guys. I’m having trouble to close the connection with postgres. And the live connections always goes up.

I already implemented does methods here. But the connection is never closed nor reutilized. ` def enter(self): return self

def __exit__(self, exc, val, traceback):
    if self.db:
        self.db.close()

`

Could you tell me what I am doing wrong?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
RazerMcommented, Jun 24, 2017

This should be re-opened until #98 is merged. Records’ close() behaviour is broken unless user passes poolclass=NullPool.

1reaction
iurisilviocommented, May 25, 2016

I think it’s SQLAlchemy connection pooling working as expected.

It is possible to disable pooling, but I never tried do it with URL configuration (something like ?poolclass=None).

http://docs.sqlalchemy.org/en/latest/core/pooling.html

Read more comments on GitHub >

github_iconTop Results From Across the Web

The connection was not closed, The connection's current state ...
The close SHOULD be in the finally, which means that the conn needs to be declared outside of the try.
Read more >
The connection was not closed. The connection's current state ...
Quote: The connection was not closed. The connection's current state is open. Quite clear. You need to close the connection as soon as...
Read more >
How To Fix "ERR_CONNECTION_CLOSED" in Chrome (13 ...
How To Fix “ERR_CONNECTION_CLOSED” in Google Chrome (13 Solutions) · 1. Check Your Internet Connection · 2. Reset Your Network Settings · 3....
Read more >
The connection was not closed. The connection's ... - MSDN
You have already opened the connection just before creating the GUID and you are trying to reopen the connection. Try commenting that line...
Read more >
The connection was not closed. The connection's ... - GitHub
When an exception happens, depending on the exception type, the physical connection may get closed (e.g. networking issue) or not (e.g. database ...
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