There are numerous questions about using a db connection pool with Google App Engine, but a lot has changed recently. Up to this point, I could never get a connection pool to work with GAE. However, I think some recent develops may allow connection pooling to work, which may be why it is mentioned in the Google documentation (which seems to have recently been updated).
https://cloud.google.com/sql/docs/mysql/connect-app-engine
Can someone confirm that connection pools can be used?
1) We used Google Cloud SQL 1st gen and the database could deactivate (go to sleep). This would make any existing connections stale.
With a 2nd gen database, there is no deactivtion of databases. So this may address the problem.
2) Many connection pool implementations used threads.
With Java 8 being supported on GAE, it looks like threads are permitted.
3) Some people suggest that GAE's limited number of database connections (12) are a reason to use connection pools. The connection pool size could be set to GAE's limit and thus an app would never exceed the limit.
a) First, documentation indicates a much larger number of connections, based on the size of the database.
https://cloud.google.com/sql/docs/quotas
b) Second, if there is a limit for a GAE app, is the limit per individual server instance or for an entire GAE app?
Any confirmation that the above thinking makes sense would be appreciated.