kikocis/java-driver public
Changesets · Branches · Tags · Compare
| Changeset | 3c8983f20e6b22ea0e377254f387ba68d1e7f4ed529e07988eaa52589459c339 |
|---|---|
| Author | olim7t <omichallat+github@gmail.com> · 2014-09-16 21:43 -07:00 |
| Committer | olim7t <omichallat+github@gmail.com> · 2014-09-16 21:43 -07:00 |
| Parents | 4aa3e0b31f6b |
1 file changed
modified driver-core/src/main/java/com/datastax/driver/core/PooledConnection.java +8 −2
| @@ -34,10 +34,16 @@ | ||
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | /** |
| 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. | |
| 39 | 39 | */ |
| 40 | 40 | 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 | + | |
| 41 | 47 | pool.returnConnection(this); |
| 42 | 48 | } |
| 43 | 49 |