mysql
mysql copied to clipboard
Connection pool: custom connection state
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:
- I can get different connection which won't do as "A prepared statement is specific to the session in which it was created"
- 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