[BUG] Pool connections closed by the server are never reinitialized
See original GitHub issueDescribe your system
odbcPackage Version: latest- ODBC Driver: Plex
- Database Name: Plex (Postgres based)
- Node.js Version: 12.22
- Node.js OS: Debian
Describe the bug When using pool connections, if the server just end the session, all connections at the freeConnections array will be in an invalid state. They are still marked as “connected” but they cannot be used. We have only 5 items at freeConnections, all with connected = true, but every usage attempt on any of them raises the error:
code: 2208
message: "[DataDirect][ODBC OpenAccess SDK driver][OpenAccess SDK Client]Internal network error, session aborted, connection closed"
state: "08S01"
Im describing this as a Pool error, because its “expected” from the pool to manage this, but its actually an error at the connection level, not detecting this.
Expected behavior Errored connections inside a pool should really close, leaving room for opening new connections in their place.
To Reproduce Steps to reproduce the behavior:
- Initialize a pool, run some queries
- Make connections enter in a Closed state (aborting/closing by the server-side)
- Run a new query
Issue Analytics
- State:
- Created 2 years ago
- Reactions:3
- Comments:6
Top Results From Across the Web
How can I solve a connection pool problem between ASP.NET ...
In most cases connection pooling problems are related to connection leaks. Your application probably doesn't close its database connections correctly and ...
Read more >issue with connection pool ? #7644 - prisma/prisma - GitHub
It looks like some connections are not re-used, as if they were waiting for the server or something. What can I do, application-side,...
Read more >java.sql.SQLException: Io exception: Connection reset
- Set your steady-connection size to 0. With this, the pool will close out idle connections before their connections get reset. Note that...
Read more >Connector/NET does not obey Connect Timeout - MySQL Bugs
3) When connections are released back to the pool, run "RESET CONNECTION STATE" ... Server problems never affect the pooling logic itself.
Read more >4.7. The Mysteries of Connection Close - HTTP - O'Reilly
Servers shouldn't close a connection in the middle of a response unless client or network failure is suspected.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Looks like the pool does not check if the connection is still connected before handing it back. There is a “connected” attribute which retrieves the SQL_ATTR_CONNECTION_DEAD property which can be used to check this. This is how ODBC driver manager connection pooling checks for usable connections as documented here: https://docs.microsoft.com/en-us/sql/odbc/reference/develop-app/driver-manager-connection-pooling
Can we re-open this issue still getting that error message