diff --git a/core/src/main/java/me/prettyprint/cassandra/connection/HConnectionManager.java b/core/src/main/java/me/prettyprint/cassandra/connection/HConnectionManager.java index fc4241639..b8574eb7f 100644 --- a/core/src/main/java/me/prettyprint/cassandra/connection/HConnectionManager.java +++ b/core/src/main/java/me/prettyprint/cassandra/connection/HConnectionManager.java @@ -248,12 +248,12 @@ public void operateWithFailover(Operation op) throws HectorException { // TODO how to 'timeout' on this op when underlying pool is exhausted pool = getClientFromLBPolicy(excludeHosts); client = pool.borrowClient(); - Cassandra.Client c = client.getCassandra(op.keyspaceName); // Keyspace can be null for some system_* api calls if ( op.credentials != null && !op.credentials.isEmpty() && !client.isAlreadyAuthenticated(op.credentials)) { - c.login(new AuthenticationRequest(op.credentials)); + client.getCassandra().login(new AuthenticationRequest(op.credentials)); client.setAuthenticated(op.credentials); } + Cassandra.Client c = client.getCassandra(op.keyspaceName); op.executeAndSetResult(c, pool.getCassandraHost()); success = true;