mysql icon indicating copy to clipboard operation
mysql copied to clipboard

Connection pool: custom connection state

Open Chrys4lisfag opened this issue 10 months ago • 4 comments

It is cool to see connection pool feature being developed right now!

Currently I use my own very simple implementation and as I have full control of the pooled connection, I try to prepare some statements on connection init and later reuse them from the pooled connection.

Taking brief look it seams that I am will not able to save cached statement and reuse it in my next request as:

  1. I can get different connection which won't do as "A prepared statement is specific to the session in which it was created"
  2. Internal reconnection which I do not control and statement could be deallocated.

If I understood correctly about these issues currently couldn't be resolved for caching statements myself, could I do feature request to add optional internal statements caching, so when we do prepare statement it could cache on first use\pop from cache. And may be some control for caching strategy always\frequent\manually selected

Chrys4lisfag avatar Apr 22 '24 19:04 Chrys4lisfag