com.google.cloud.spanner.jdbc

## Class SpannerPool

- java.lang.Object
- - com.google.cloud.spanner.jdbc.SpannerPool

    public class SpannerPool
    extends Object

Pool for keeping track of `Spanner` instances needed by JDBC connections.

When a JDBC connection is opened for a Google Cloud Spanner database, a `Spanner` object can be opened in the background. The `SpannerPool` keeps track of which `Spanner` objects have been opened by connections during the lifetime of the JVM, which connections are still opened and closed, and which `Spanner` objects could be closed.

Call the method `closeSpannerPool()` at the end of your application to gracefully shutdown all instances in the pool.

### Method Summary

All Methods Static Methods Concrete Methods
`static void` `closeSpannerPool()` Closes the default `SpannerPool` and all `Spanner` instances that have been opened by connections and that are still open.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Method Detail

#### closeSpannerPool

    public static void closeSpannerPool()

Closes the default `SpannerPool` and all `Spanner` instances that have been opened by connections and that are still open. Call this method at the end of your application to gracefully close all `Spanner` instances in the pool. Failing to call this method will keep your application running for 60 seconds after you close the last `Connection` to Cloud Spanner, as this is the default timeout before the `SpannerPool` closes the unused `Spanner` instances.