olavloite / spanner-jdbc

JDBC Driver for Google Cloud Spanner
MIT License
38 stars 10 forks source link

Opening multiple connections to the same database generates a large number of monitoring threads #48

Closed olavloite closed 6 years ago

olavloite commented 6 years ago

When opening a large number of connections to the same Cloud Spanner database, the jdbc driver will also create and open a large number of com.google.cloud.spanner.Spanner instances. These instances should be pooled and only one per actual database should be opened in order to limit memory consumption and the number of threads.

olavloite commented 6 years ago

Spanner instances are now shared between all connections that connect to the same Google Project using the same credentials.