Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #86 from tjake/cqlversion-fix

Only set cql version once per connection
  • Loading branch information...
commit 4423a23067f5c37b49283a7b9f0f29792cf9ebaf 2 parents d05b40e + a7e47ce
@nberardi nberardi authored
Showing with 6 additions and 1 deletion.
  1. +6 −1 src/Connections/Connection.cs
View
7 src/Connections/Connection.cs
@@ -15,6 +15,7 @@ public class Connection : IConnection, IDisposable
private TTransport _transport;
private Cassandra.Client _client;
private string _activeKeyspace;
+ private string _activeCqlVersion;
private readonly object _lock = new object();
/// <summary>
@@ -185,7 +186,11 @@ public void SetCqlVersion(string cqlVersion)
if (!IsOpen)
throw new CassandraConnectionException("A connection to Cassandra has not been opened.");
- Client.set_cql_version(cqlVersion);
+ if (_activeCqlVersion == null || !_activeCqlVersion.Equals(cqlVersion))
+ {
+ Client.set_cql_version(cqlVersion);
+ _activeCqlVersion = cqlVersion;
+ }
}
/// <summary>

0 comments on commit 4423a23

Please sign in to comment.
Something went wrong with that request. Please try again.