-
Notifications
You must be signed in to change notification settings - Fork 53
Description
Expected Behavior
When returning a connection to the pool, the connection is reset. This invalidates any prepared statements. It is desired to prepare statements and continue using them if the same connection is re-acquired from the pool. In the case of certain errors (in tedious or in code using the pool), it is also desired to allow a connection to be reset.
To accomplish this, an additional parameter can be passed to Connection.release(suppressReset). When suppressReset is not passed (old behavior) or passed with a falsy value, reset the connection as was previously done. When suppressReset is passed with a truthy value (new behavior), return the connection to the pool without resetting it.
Current Behavior
When a truthy argument is passed to Connection.release, return the connection to the pool WITHOUT resetting it.
Steps to Reproduce (for bugs)
N/A
Reason For Request (for feature requests)
I've seen a notable performance improvement for certain queries when running them as prepared statements, but resetting the connection invalidates prepared statements.
Possible Solution
see SensusDa/tedious-connection-pool@35b4417ae9b6517c5bbdfbc6b2a9a21ef6a49f85
Background Details
Running code which used prepared statements and a custom version of tedious-connection-pool with changes as shown in the commit above resulted in a notable performance improvement.
Environment
N/A