Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Fixed authentication issue and performance issue after authenticated #124

Merged
merged 2 commits into from

2 participants

@ssteo

Fixed authentication issue when trying to set keyspace before authenticated mentioned here
#119

Fixed performance issue of re-authenticating each time when ExecuteNonQuery calls to Session.GetClient()
#121

@nberardi nberardi merged commit 31f5ab3 into from
@nberardi
Owner

Thank you for the pull request.

@ssteo

Welcome and thank you for actively maintaining this Cassandra driver as OSS project :+1:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/CassandraSession.cs
View
4 src/CassandraSession.cs
@@ -111,7 +111,7 @@ internal CassandraClientWrapper GetClient(bool setKeyspace = true, bool? setCqlV
if (setCqlVersion.Value)
_connection.SetCqlVersion(builder.CqlVersion);
- if (setLogin && !String.IsNullOrWhiteSpace(builder.Username) && !String.IsNullOrWhiteSpace(builder.Password))
+ if (!IsAuthenticated && setLogin && !String.IsNullOrWhiteSpace(builder.Username) && !String.IsNullOrWhiteSpace(builder.Password))
Login(builder.Username, builder.Password);
return new CassandraClientWrapper(_connection.Client);
@@ -149,7 +149,7 @@ public void Login(string username, string password)
try
{
- GetClient(setLogin: false).login(auth);
+ GetClient(setKeyspace: false, setLogin: false).login(auth);
IsAuthenticated = true;
}
catch (Exception exc)
Something went wrong with that request. Please try again.