I tried to adjust the configs numerous ways but nothing worked. The only way I was able to resolve the issue was instead of using the same connection over and over (about 100-150 queries) it worked fine. I played with maxLifetime, minimumIdle, idleTimeout, validationTimeout, etc. with no luck. Every value well past the time it took to run the queries by a massive margin (as in it took a few seconds to run).
To replicate specifically the following failed consistently around 100-150 queries (in my case inserts). Yes I should be using batching, and I will, but I was trying to test the individual sql queries to figure out if and where my script had any issues before batching them.
The only difference being the connection is the same in the first whereas the connection is grabbed from the pool each time in the bottom one. I had a max pool size of 3.
** Now here's where it gets really weird. If I set the max pool size to 1 then the initially connection times out after 30 seconds but after that it's able to run all the rest of the sql queries without any issues. I tested up to about 300 queries and it was fine. But it had to time out on the first query before it was able to successfully run.
I tried to adjust the configs numerous ways but nothing worked. The only way I was able to resolve the issue was instead of using the same connection over and over (about 100-150 queries) it worked fine. I played with maxLifetime, minimumIdle, idleTimeout, validationTimeout, etc. with no luck. Every value well past the time it took to run the queries by a massive margin (as in it took a few seconds to run).
To replicate specifically the following failed consistently around 100-150 queries (in my case inserts). Yes I should be using batching, and I will, but I was trying to test the individual sql queries to figure out if and where my script had any issues before batching them.
However this worked consistently:
The only difference being the connection is the same in the first whereas the connection is grabbed from the pool each time in the bottom one. I had a max pool size of 3.
** Now here's where it gets really weird. If I set the max pool size to 1 then the initially connection times out after 30 seconds but after that it's able to run all the rest of the sql queries without any issues. I tested up to about 300 queries and it was fine. But it had to time out on the first query before it was able to successfully run.