Class SpannerPool
- java.lang.Object
-
- com.google.cloud.spanner.connection.SpannerPool
-
public class SpannerPool extends Object
Pool for keeping track ofSpannerinstances needed for connections.When a connection is opened for a Google Cloud Spanner database, a
Spannerobject can be opened in the background. TheSpannerPoolkeeps track of whichSpannerobjects have been opened by connections during the lifetime of the JVM, which connections are still opened and closed, and whichSpannerobjects 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 Modifier and Type Method Description static voidcloseSpannerPool()Closes the defaultSpannerPooland allSpannerinstances that have been opened by connections and that are still open.
-
-
-
Method Detail
-
closeSpannerPool
public static void closeSpannerPool()
Closes the defaultSpannerPooland allSpannerinstances that have been opened by connections and that are still open. Call this method at the end of your application to gracefully close allSpannerinstances in the pool. Failing to call this method will keep your application running for 60 seconds after you close the lastConnectionto Cloud Spanner, as this is the default timeout before theSpannerPoolcloses the unusedSpannerinstances.
-
-