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.

execute() seems to not close the DB connection properly

See original GitHub issue

Specifically, when executing Count queries on views:

q = 'SELECT count(*) AS count_1 FROM view_xyz123'

eng = sa.Engine('psql_settings`) # connect to a Postgresql db 

result = eng.execute(sa.text(q))

Despite close_with_result always being set to True in execute(), I am seeing open connections stack up in PSQL when running this repeatedly.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
edwardkwcommented, Nov 13, 2019

@zzzeek Just wanted to thank you very much for your help, especially as this wasn’t necessarily a proper bug.

1reaction
zzzeekcommented, Nov 13, 2019
Read more comments on GitHub >

github_iconTop Results From Across the Web

Closing database connections in Java - Stack Overflow
When you are done with using your Connection , you need to explicitly close it by calling its close() method in order to...
Read more >
database connections not closing.... - MSDN - Microsoft
Question. I'm having some problems with connections to an SQL database not closing after being opened, which is maxxing out the pool and ......
Read more >
Common Reasons Why Connections Stay Open for a Long ...
Applications Not Properly Closing Connections; Long Database Queries; Shared Connections with Local Transaction Containment; Embedded getConnection Requests.
Read more >
What will happen if we do not close the connection object in ...
If the database sever grants all of them, and after their usage they are not closed, the database server would not be able...
Read more >
Oracle JDBC connection cannot be closed properly
I encountered a problem that Oracle JDBC connection cannot be close properly after "java.sql.SQLException: Io exception: Read timed out" is ...
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