Elffuss BraidHub

kikocis/java-driver public

Handle null pool in PooledConnection.release (JAVA-449).
Changeset3c8983f20e6b22ea0e377254f387ba68d1e7f4ed529e07988eaa52589459c339
Authorolim7t <omichallat+github@gmail.com> · 2014-09-16 21:43 -07:00
Committerolim7t <omichallat+github@gmail.com> · 2014-09-16 21:43 -07:00
Parents4aa3e0b31f6b

Browse the files at this changeset

1 file changed

modified driver-core/src/main/java/com/datastax/driver/core/PooledConnection.java +8 −2
@@ -34,10 +34,16 @@
3434 }
3535
3636 /**
37- * Return the pooled connection to it's pool.
38- * The connection should generally not be reuse after that.
37+ * Return the pooled connection to its pool.
38+ * The connection should generally not be reused after that.
3939 */
4040 public void release() {
41+ // This can happen if the query to initialize the transport in the
42+ // parent constructor times out. In that case the pool will handle
43+ // it itself.
44+ if (pool == null)
45+ return;
46+
4147 pool.returnConnection(this);
4248 }
4349