/// <summary> /// Subclass should call this to close the connection. /// </summary> protected void CloseConnection() { lock (ConnectionCreationLock) { if (connection != null) { connection.Close(); } connection = null; } }