You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by yz...@apache.org on 2017/01/11 14:21:44 UTC

[1/9] ignite git commit: IGNITE-4493: ODBC: Added missing diagnostic records for error cases

Repository: ignite
Updated Branches:
  refs/heads/ignite-comm-balance-master 54e72b1fb -> 9339e9159


IGNITE-4493: ODBC: Added missing diagnostic records for error cases

This closes #1396


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/9e8e9798
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/9e8e9798
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/9e8e9798

Branch: refs/heads/ignite-comm-balance-master
Commit: 9e8e9798dae8b92cfbf4d940856dec35d3e30f54
Parents: bf118aa
Author: Sergey Kalashnikov <sk...@gridgain.com>
Authored: Tue Jan 10 11:10:56 2017 +0300
Committer: Pavel Tupitsyn <pt...@apache.org>
Committed: Tue Jan 10 11:10:56 2017 +0300

----------------------------------------------------------------------
 .../cpp/odbc-test/src/api_robustness_test.cpp   | 113 +++++++++++-
 .../cpp/odbc/include/ignite/odbc/common_types.h |  29 ++-
 .../cpp/odbc/include/ignite/odbc/statement.h    | 143 +++++++++++----
 modules/platforms/cpp/odbc/src/connection.cpp   |   2 +-
 .../odbc/src/diagnostic/diagnostic_record.cpp   |  38 ++++
 modules/platforms/cpp/odbc/src/odbc.cpp         | 118 ++++---------
 modules/platforms/cpp/odbc/src/statement.cpp    | 176 ++++++++++++++++---
 7 files changed, 484 insertions(+), 135 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/9e8e9798/modules/platforms/cpp/odbc-test/src/api_robustness_test.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc-test/src/api_robustness_test.cpp b/modules/platforms/cpp/odbc-test/src/api_robustness_test.cpp
index 13a5ea6..0b6df93 100644
--- a/modules/platforms/cpp/odbc-test/src/api_robustness_test.cpp
+++ b/modules/platforms/cpp/odbc-test/src/api_robustness_test.cpp
@@ -50,7 +50,7 @@ using ignite::impl::binary::BinaryUtils;
 /**
  * Test setup fixture.
  */
-struct ApiRobustnessTestSuiteFixture 
+struct ApiRobustnessTestSuiteFixture
 {
     void Prepare()
     {
@@ -206,6 +206,33 @@ struct ApiRobustnessTestSuiteFixture
 
         // Operation is not supported. However, there should be no crash.
         BOOST_CHECK(ret == SQL_ERROR);
+
+        CheckSQLStatementDiagnosticError("HY106");
+    }
+
+    void CheckSQLDiagnosticError(int16_t handleType, SQLHANDLE handle, const std::string& expectSqlState)
+    {
+        SQLCHAR state[ODBC_BUFFER_SIZE];
+        SQLINTEGER nativeError = 0;
+        SQLCHAR message[ODBC_BUFFER_SIZE];
+        SQLSMALLINT messageLen = 0;
+
+        SQLRETURN ret = SQLGetDiagRec(handleType, handle, 1, state, &nativeError, message, sizeof(message), &messageLen);
+
+        const std::string sqlState = reinterpret_cast<char*>(state);
+        BOOST_REQUIRE_EQUAL(ret, SQL_SUCCESS);
+        BOOST_REQUIRE_EQUAL(sqlState, expectSqlState);
+        BOOST_REQUIRE(messageLen > 0);
+    }
+
+    void CheckSQLStatementDiagnosticError(const std::string& expectSqlState)
+    {
+        CheckSQLDiagnosticError(SQL_HANDLE_STMT, stmt, expectSqlState);
+    }
+
+    void CheckSQLConnectionDiagnosticError(const std::string& expectSqlState)
+    {
+        CheckSQLDiagnosticError(SQL_HANDLE_DBC, dbc, expectSqlState);
     }
 
     /**
@@ -234,6 +261,43 @@ struct ApiRobustnessTestSuiteFixture
     SQLHSTMT stmt;
 };
 
+SQLSMALLINT unsupportedC[] = {
+        SQL_C_INTERVAL_YEAR,
+        SQL_C_INTERVAL_MONTH,
+        SQL_C_INTERVAL_DAY,
+        SQL_C_INTERVAL_HOUR,
+        SQL_C_INTERVAL_MINUTE,
+        SQL_C_INTERVAL_SECOND,
+        SQL_C_INTERVAL_YEAR_TO_MONTH,
+        SQL_C_INTERVAL_DAY_TO_HOUR,
+        SQL_C_INTERVAL_DAY_TO_MINUTE,
+        SQL_C_INTERVAL_DAY_TO_SECOND,
+        SQL_C_INTERVAL_HOUR_TO_MINUTE,
+        SQL_C_INTERVAL_HOUR_TO_SECOND,
+        SQL_C_INTERVAL_MINUTE_TO_SECOND
+    };
+
+SQLSMALLINT unsupportedSql[] = {
+        SQL_WVARCHAR,
+        SQL_WLONGVARCHAR,
+        SQL_REAL,
+        SQL_NUMERIC,
+        SQL_TYPE_TIME,
+        SQL_INTERVAL_MONTH,
+        SQL_INTERVAL_YEAR,
+        SQL_INTERVAL_YEAR_TO_MONTH,
+        SQL_INTERVAL_DAY,
+        SQL_INTERVAL_HOUR,
+        SQL_INTERVAL_MINUTE,
+        SQL_INTERVAL_SECOND,
+        SQL_INTERVAL_DAY_TO_HOUR,
+        SQL_INTERVAL_DAY_TO_MINUTE,
+        SQL_INTERVAL_DAY_TO_SECOND,
+        SQL_INTERVAL_HOUR_TO_MINUTE,
+        SQL_INTERVAL_HOUR_TO_SECOND,
+        SQL_INTERVAL_MINUTE_TO_SECOND
+    };
+
 BOOST_FIXTURE_TEST_SUITE(ApiRobustnessTestSuite, ApiRobustnessTestSuiteFixture)
 
 BOOST_AUTO_TEST_CASE(TestSQLDriverConnect)
@@ -516,6 +580,19 @@ BOOST_AUTO_TEST_CASE(TestSQLBindCol)
 
     ODBC_FAIL_ON_ERROR(ret, SQL_HANDLE_STMT, stmt);
 
+    //Unsupported data types
+    for(int i = 0; i < sizeof(unsupportedC)/sizeof(unsupportedC[0]); ++i)
+    {
+        ret = SQLBindCol(stmt, 1, unsupportedC[i], &ind1, sizeof(ind1), &len1);
+        BOOST_REQUIRE_EQUAL(ret, SQL_ERROR);
+        CheckSQLStatementDiagnosticError("HY003");
+    }
+
+    // Size is negative.
+    ret = SQLBindCol(stmt, 1, SQL_C_SLONG, &ind1, -1, &len1);
+    BOOST_REQUIRE_EQUAL(ret, SQL_ERROR);
+    CheckSQLStatementDiagnosticError("HY090");
+
     // Size is null.
     SQLBindCol(stmt, 1, SQL_C_SLONG, &ind1, 0, &len1);
 
@@ -545,6 +622,24 @@ BOOST_AUTO_TEST_CASE(TestSQLBindParameter)
 
     ODBC_FAIL_ON_ERROR(ret, SQL_HANDLE_STMT, stmt);
 
+    //Unsupported parameter type : output
+    SQLBindParameter(stmt, 2, SQL_PARAM_OUTPUT, SQL_C_SLONG, SQL_INTEGER, 100, 100, &ind1, sizeof(ind1), &len1);
+    CheckSQLStatementDiagnosticError("HY105");
+
+    //Unsupported parameter type : input/output
+    SQLBindParameter(stmt, 2, SQL_PARAM_INPUT_OUTPUT, SQL_C_SLONG, SQL_INTEGER, 100, 100, &ind1, sizeof(ind1), &len1);
+    CheckSQLStatementDiagnosticError("HY105");
+
+
+    //Unsupported data types
+    for(int i = 0; i < sizeof(unsupportedSql)/sizeof(unsupportedSql[0]); ++i)
+    {
+        ret = SQLBindParameter(stmt, 2, SQL_PARAM_INPUT, SQL_C_SLONG, unsupportedSql[i], 100, 100, &ind1, sizeof(ind1), &len1);
+        BOOST_REQUIRE_EQUAL(ret, SQL_ERROR);
+        CheckSQLStatementDiagnosticError("HYC00");
+    }
+
+
     // Size is null.
     SQLBindParameter(stmt, 2, SQL_PARAM_INPUT, SQL_C_SLONG, SQL_INTEGER, 100, 100, &ind1, 0, &len1);
 
@@ -1111,4 +1206,20 @@ BOOST_AUTO_TEST_CASE(TestSQLError)
     SQLError(0, 0, 0, 0, 0, 0, 0, 0);
 }
 
+BOOST_AUTO_TEST_CASE(TestSQLDiagnosticRecords)
+{
+    Connect("DRIVER={Apache Ignite};address=127.0.0.1:11110;cache=cache");
+
+    SQLHANDLE hnd;
+    SQLRETURN ret;
+
+    ret = SQLAllocHandle(SQL_HANDLE_DESC, dbc, &hnd);
+    BOOST_REQUIRE_EQUAL(ret, SQL_ERROR);
+    CheckSQLConnectionDiagnosticError("IM001");
+
+    ret = SQLFreeStmt(stmt, 4);
+    BOOST_REQUIRE_EQUAL(ret, SQL_ERROR);
+    CheckSQLStatementDiagnosticError("HY092");
+}
+
 BOOST_AUTO_TEST_SUITE_END()

http://git-wip-us.apache.org/repos/asf/ignite/blob/9e8e9798/modules/platforms/cpp/odbc/include/ignite/odbc/common_types.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/include/ignite/odbc/common_types.h b/modules/platforms/cpp/odbc/include/ignite/odbc/common_types.h
index 517fe4e..5d8901d 100644
--- a/modules/platforms/cpp/odbc/include/ignite/odbc/common_types.h
+++ b/modules/platforms/cpp/odbc/include/ignite/odbc/common_types.h
@@ -113,15 +113,37 @@ namespace ignite
              */
             SQL_STATE_HY001_MEMORY_ALLOCATION,
 
+            /**
+             * The argument TargetType was neither a valid data type
+             * nor SQL_C_DEFAULT
+             */
+            SQL_STATE_HY003_INVALID_APPLICATION_BUFFER_TYPE,
+
             /** Invalid use of null pointer. */
             SQL_STATE_HY009_INVALID_USE_OF_NULL_POINTER,
 
             /** Function sequence error. */
             SQL_STATE_HY010_SEQUENCE_ERROR,
 
+            /**
+             * Invalid string or buffer length
+             */
+            SQL_STATE_HY090_INVALID_STRING_OR_BUFFER_LENGTH,
+
+            /**
+             * Option type was out of range.
+             */
+            SQL_STATE_HY092_OPTION_TYPE_OUT_OF_RANGE,
+
             /** Column type out of range. */
             SQL_STATE_HY097_COLUMN_TYPE_OUT_OF_RANGE,
 
+            /** The value specified for the argument InputOutputType was invalid. */
+            SQL_STATE_HY105_INVALID_PARAMETER_TYPE,
+
+            /** The value specified for the argument FetchOrientation was invalid. */
+            SQL_STATE_HY106_FETCH_TYPE_OUT_OF_RANGE,
+
             /**
              * The driver does not support the feature of ODBC behavior that
              * the application requested.
@@ -132,7 +154,12 @@ namespace ignite
              * The connection timeout period expired before the data source
              * responded to the request.
              */
-            SQL_STATE_HYT01_CONNECTIOIN_TIMEOUT
+            SQL_STATE_HYT01_CONNECTIOIN_TIMEOUT,
+
+            /**
+             * Driver does not support this function.
+             */
+            SQL_STATE_IM001_FUNCTION_NOT_SUPPORTED
         };
 
         /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/9e8e9798/modules/platforms/cpp/odbc/include/ignite/odbc/statement.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/include/ignite/odbc/statement.h b/modules/platforms/cpp/odbc/include/ignite/odbc/statement.h
index db56660..596fc66 100644
--- a/modules/platforms/cpp/odbc/include/ignite/odbc/statement.h
+++ b/modules/platforms/cpp/odbc/include/ignite/odbc/statement.h
@@ -57,24 +57,15 @@ namespace ignite
             ~Statement();
 
             /**
-             * Bind result column to specified data buffer.
+             * Bind result column to data buffer provided by application
              *
              * @param columnIdx Column index.
-             * @param buffer Buffer to put column data to.
+             * @param targetType Type of target buffer.
+             * @param targetValue Pointer to target buffer.
+             * @param bufferLength Length of target buffer.
+             * @param strLengthOrIndicator Pointer to the length/indicator buffer.
              */
-            void BindColumn(uint16_t columnIdx, const app::ApplicationDataBuffer& buffer);
-
-            /**
-             * Unbind specified column buffer.
-             *
-             * @param columnIdx Column index.
-             */
-            void UnbindColumn(uint16_t columnIdx);
-
-            /**
-             * Unbind all column buffers.
-             */
-            void UnbindAllColumns();
+            void BindColumn(uint16_t columnIdx, int16_t targetType, void* targetValue, SqlLen bufferLength, SqlLen* strLengthOrIndicator);
 
             /**
              * Set column binding offset pointer.
@@ -101,21 +92,17 @@ namespace ignite
              * Bind parameter.
              *
              * @param paramIdx Parameter index.
-             * @param param Parameter.
-             */
-            void BindParameter(uint16_t paramIdx, const app::Parameter& param);
-
-            /**
-             * Unbind specified parameter.
-             *
-             * @param paramIdx Parameter index.
+             * @param ioType Type of the parameter (input/output).
+             * @param bufferType The data type of the parameter.
+             * @param paramSqlType The SQL data type of the parameter.
+             * @param columnSize  The size of the column or expression of the corresponding parameter marker.
+             * @param decDigits  The decimal digits of the column or expression of the corresponding parameter marker.
+             * @param buffer A pointer to a buffer for the parameter's data.
+             * @param bufferLen Length of the ParameterValuePtr buffer in bytes.
+             * @param resLen A pointer to a buffer for the parameter's length.
              */
-            void UnbindParameter(uint16_t paramIdx);
-
-            /**
-             * Unbind all parameters.
-             */
-            void UnbindAllParameters();
+            void BindParameter(uint16_t paramIdx, int16_t ioType, int16_t bufferType, int16_t paramSqlType,
+                               SqlUlen columnSize, int16_t decDigits, void* buffer, SqlLen bufferLen, SqlLen* resLen);
 
             /**
              * Set statement attribute.
@@ -171,7 +158,7 @@ namespace ignite
              * @param query SQL query.
              */
             void PrepareSqlQuery(const std::string& query);
-            
+
             /**
              * Execute SQL query.
              *
@@ -254,11 +241,24 @@ namespace ignite
             void ExecuteGetTypeInfoQuery(int16_t sqlType);
 
             /**
+             * Free resources
+             * @param option indicates what needs to be freed
+             */
+            void FreeResources(int16_t option);
+
+            /**
              * Close statement.
              */
             void Close();
 
             /**
+             * Fetch query result row with offset
+             * @param orientation Fetch type
+             * @param offset Fetch offset
+             */
+            void FetchScroll(int16_t orientation, int64_t offset);
+
+            /**
              * Fetch query result row.
              */
             void FetchRow();
@@ -362,14 +362,75 @@ namespace ignite
         private:
             IGNITE_NO_COPY_ASSIGNMENT(Statement);
 
+
+            /**
+             * Bind result column to specified data buffer.
+             *
+             * @param columnIdx Column index.
+             * @param buffer Buffer to put column data to.
+             */
+            void SafeBindColumn(uint16_t columnIdx, const app::ApplicationDataBuffer& buffer);
+
+            /**
+             * Unbind specified column buffer.
+             *
+             * @param columnIdx Column index.
+             */
+            void SafeUnbindColumn(uint16_t columnIdx);
+
+            /**
+             * Unbind all column buffers.
+             */
+            void SafeUnbindAllColumns();
+
+            /**
+             * Bind result column to data buffer provided by application
+             *
+             * @param columnIdx Column index.
+             * @param targetType Type of target buffer.
+             * @param targetValue Pointer to target buffer.
+             * @param bufferLength Length of target buffer.
+             * @param strLengthOrIndicator Pointer to the length/indicator buffer.
+             * @return Operation result.
+             */
+            SqlResult InternalBindColumn(uint16_t columnIdx, int16_t targetType, void* targetValue, SqlLen bufferLength, SqlLen* strLengthOrIndicator);
+
             /**
              * Bind parameter.
              *
              * @param paramIdx Parameter index.
              * @param param Parameter.
+             */
+            void SafeBindParameter(uint16_t paramIdx, const app::Parameter& param);
+
+            /**
+             * Unbind specified parameter.
+             *
+             * @param paramIdx Parameter index.
+             */
+            void SafeUnbindParameter(uint16_t paramIdx);
+
+            /**
+             * Unbind all parameters.
+             */
+            void SafeUnbindAllParameters();
+
+            /**
+             * Bind parameter.
+             *
+             * @param paramIdx Parameter index.
+             * @param ioType Type of the parameter (input/output).
+             * @param bufferType The data type of the parameter.
+             * @param paramSqlType The SQL data type of the parameter.
+             * @param columnSize  The size of the column or expression of the corresponding parameter marker.
+             * @param decDigits  The decimal digits of the column or expression of the corresponding parameter marker.
+             * @param buffer A pointer to a buffer for the parameter's data.
+             * @param bufferLen Length of the ParameterValuePtr buffer in bytes.
+             * @param resLen A pointer to a buffer for the parameter's length.
              * @return Operation result.
              */
-            SqlResult InternalBindParameter(uint16_t paramIdx, const app::Parameter& param);
+            SqlResult InternalBindParameter(uint16_t paramIdx, int16_t ioType, int16_t bufferType, int16_t paramSqlType,
+                                            SqlUlen columnSize, int16_t decDigits, void* buffer, SqlLen bufferLen, SqlLen* resLen);
 
             /**
              * Set statement attribute.
@@ -403,6 +464,14 @@ namespace ignite
              */
             SqlResult InternalGetColumnData(uint16_t columnIdx, app::ApplicationDataBuffer& buffer);
 
+
+            /**
+             * Free resources
+             * @param option indicates what needs to be freed
+             * @return Operation result.
+             */
+            SqlResult InternalFreeResources(int16_t option);
+
             /**
              * Close statement.
              * Internal call.
@@ -418,7 +487,7 @@ namespace ignite
              * @return Operation result.
              */
             SqlResult InternalPrepareSqlQuery(const std::string& query);
-            
+
             /**
              * Execute SQL query.
              *
@@ -435,6 +504,14 @@ namespace ignite
             SqlResult InternalExecuteSqlQuery();
 
             /**
+             * Fetch query result row with offset
+             * @param orientation Fetch type
+             * @param offset Fetch offset
+             * @return Operation result.
+             */
+            SqlResult InternalFetchScroll(int16_t orientation, int64_t offset);
+
+            /**
              * Fetch query result row.
              *
              * @return Operation result.
@@ -621,7 +698,7 @@ namespace ignite
 
             /** Offset added to pointers to change binding of parameters. */
             int* paramBindOffset;
-            
+
             /** Offset added to pointers to change binding of column data. */
             int* columnBindOffset;
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/9e8e9798/modules/platforms/cpp/odbc/src/connection.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/src/connection.cpp b/modules/platforms/cpp/odbc/src/connection.cpp
index 2afa42d..4a6de5e 100644
--- a/modules/platforms/cpp/odbc/src/connection.cpp
+++ b/modules/platforms/cpp/odbc/src/connection.cpp
@@ -226,7 +226,7 @@ namespace ignite
 
             OdbcProtocolHeader hdr;
 
-            int64_t received = ReceiveAll(reinterpret_cast<int8_t*>(&hdr), sizeof(hdr));
+            size_t received = ReceiveAll(reinterpret_cast<int8_t*>(&hdr), sizeof(hdr));
 
             if (received != sizeof(hdr))
                 IGNITE_ERROR_1(IgniteError::IGNITE_ERR_GENERIC, "Can not receive message header");

http://git-wip-us.apache.org/repos/asf/ignite/blob/9e8e9798/modules/platforms/cpp/odbc/src/diagnostic/diagnostic_record.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/src/diagnostic/diagnostic_record.cpp b/modules/platforms/cpp/odbc/src/diagnostic/diagnostic_record.cpp
index 215d77f..3c411d2 100644
--- a/modules/platforms/cpp/odbc/src/diagnostic/diagnostic_record.cpp
+++ b/modules/platforms/cpp/odbc/src/diagnostic/diagnostic_record.cpp
@@ -64,17 +64,35 @@ namespace
     /** SQL state HY001 constant. */
     const std::string STATE_HY001 = "HY001";
 
+    /** SQL state HY003 constant. */
+    const std::string STATE_HY003 = "HY003";
+
     /** SQL state HY009 constant. */
     const std::string STATE_HY009 = "HY009";
 
     /** SQL state HY010 constant. */
     const std::string STATE_HY010 = "HY010";
 
+    /** SQL state HY092 constant. */
+    const std::string STATE_HY092 = "HY092";
+
+    /** SQL state HY105 constant. */
+    const std::string STATE_HY105 = "HY105";
+
+    /** SQL state HY106 constant. */
+    const std::string STATE_HY106 = "HY106";
+
     /** SQL state HYC00 constant. */
     const std::string STATE_HYC00 = "HYC00";
 
     /** SQL state HYT01 constant. */
     const std::string STATE_HYT01 = "HYT01";
+
+    /** SQL state HY090 constant. */
+    const std::string STATE_HY090 = "HY090";
+
+    /** SQL state IM001 constant. */
+    const std::string STATE_IM001 = "IM001";
 }
 
 namespace ignite
@@ -130,6 +148,8 @@ namespace ignite
 
                 if (odbcSubclasses.empty())
                 {
+                    // This is a fixed list taken from ODBC doc.
+                    // Please do not add/remove values here.
                     odbcSubclasses.insert("01S00");
                     odbcSubclasses.insert("01S01");
                     odbcSubclasses.insert("01S02");
@@ -234,18 +254,36 @@ namespace ignite
                     case SQL_STATE_HY001_MEMORY_ALLOCATION:
                         return STATE_HY001;
 
+                    case SQL_STATE_HY003_INVALID_APPLICATION_BUFFER_TYPE:
+                        return STATE_HY003;
+
                     case SQL_STATE_HY009_INVALID_USE_OF_NULL_POINTER:
                         return STATE_HY009;
 
                     case SQL_STATE_HY010_SEQUENCE_ERROR:
                         return STATE_HY010;
 
+                    case SQL_STATE_HY090_INVALID_STRING_OR_BUFFER_LENGTH:
+                        return STATE_HY090;
+
+                    case SQL_STATE_HY092_OPTION_TYPE_OUT_OF_RANGE:
+                        return STATE_HY092;
+
+                    case SQL_STATE_HY105_INVALID_PARAMETER_TYPE:
+                        return STATE_HY105;
+
+                    case SQL_STATE_HY106_FETCH_TYPE_OUT_OF_RANGE:
+                        return STATE_HY106;
+
                     case SQL_STATE_HYC00_OPTIONAL_FEATURE_NOT_IMPLEMENTED:
                         return STATE_HYC00;
 
                     case SQL_STATE_HYT01_CONNECTIOIN_TIMEOUT:
                         return STATE_HYT01;
 
+                    case SQL_STATE_IM001_FUNCTION_NOT_SUPPORTED:
+                        return STATE_IM001;
+
                     default:
                         break;
                 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/9e8e9798/modules/platforms/cpp/odbc/src/odbc.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/src/odbc.cpp b/modules/platforms/cpp/odbc/src/odbc.cpp
index dbec55f..fd69c0d 100644
--- a/modules/platforms/cpp/odbc/src/odbc.cpp
+++ b/modules/platforms/cpp/odbc/src/odbc.cpp
@@ -31,6 +31,7 @@
 #include "ignite/odbc/dsn_config.h"
 #include "ignite/odbc.h"
 
+
 namespace ignite
 {
     SQLRETURN SQLGetInfo(SQLHDBC        conn,
@@ -71,6 +72,23 @@ namespace ignite
                 return SQLAllocStmt(parent, result);
 
             case SQL_HANDLE_DESC:
+            {
+                using odbc::Connection;
+                Connection *connection = reinterpret_cast<Connection*>(parent);
+
+                if (!connection)
+                    return SQL_INVALID_HANDLE;
+
+                if (result)
+                    *result = 0;
+
+                connection->GetDiagnosticRecords().Reset();
+                connection->AddStatusRecord(odbc::SQL_STATE_IM001_FUNCTION_NOT_SUPPORTED,
+                                            "The HandleType argument was SQL_HANDLE_DESC, and "
+                                            "the driver does not support allocating a descriptor handle");
+
+                return SQL_ERROR;
+            }
             default:
                 break;
         }
@@ -199,39 +217,15 @@ namespace ignite
         if (!statement)
             return SQL_INVALID_HANDLE;
 
-        switch (option)
+        if (option == SQL_DROP)
         {
-            case SQL_DROP:
-            {
-                delete statement;
-
-                break;
-            }
-
-            case SQL_CLOSE:
-            {
-                return SQLCloseCursor(stmt);
-            }
-
-            case SQL_UNBIND:
-            {
-                statement->UnbindAllColumns();
-
-                break;
-            }
-
-            case SQL_RESET_PARAMS:
-            {
-                statement->UnbindAllParameters();
-
-                break;
-            }
-
-            default:
-                return SQL_ERROR;
+            delete statement;
+            return SQL_SUCCESS;
         }
 
-        return SQL_SUCCESS;
+        statement->FreeResources(option);
+
+        return statement->GetDiagnosticRecords().GetReturnCode();
     }
 
     SQLRETURN SQLCloseCursor(SQLHSTMT stmt)
@@ -419,29 +413,14 @@ namespace ignite
         using odbc::Statement;
         using odbc::app::ApplicationDataBuffer;
 
-        LOG_MSG("SQLBindCol called: index=%d, type=%d\n", colNum, targetType);
+        LOG_MSG("SQLBindCol called: index=%d, type=%d targetValue=%p bufferLength=%d\n", colNum, targetType, targetValue, bufferLength);
 
         Statement *statement = reinterpret_cast<Statement*>(stmt);
 
         if (!statement)
             return SQL_INVALID_HANDLE;
 
-        IgniteSqlType driverType = ToDriverType(targetType);
-
-        if (driverType == IGNITE_ODBC_C_TYPE_UNSUPPORTED)
-            return SQL_ERROR;
-
-        if (bufferLength < 0)
-            return SQL_ERROR;
-
-        if (targetValue || strLengthOrIndicator)
-        {
-            ApplicationDataBuffer dataBuffer(driverType, targetValue, bufferLength, strLengthOrIndicator);
-
-            statement->BindColumn(colNum, dataBuffer);
-        }
-        else
-            statement->UnbindColumn(colNum);
+        statement->BindColumn(colNum, targetType, targetValue, bufferLength, strLengthOrIndicator);
 
         return statement->GetDiagnosticRecords().GetReturnCode();
     }
@@ -464,13 +443,19 @@ namespace ignite
 
     SQLRETURN SQLFetchScroll(SQLHSTMT stmt, SQLSMALLINT orientation, SQLLEN offset)
     {
+        using odbc::Statement;
+
         LOG_MSG("SQLFetchScroll called\n");
         LOG_MSG("Orientation: %d, Offset: %d\n", orientation, offset);
 
-        if (orientation != SQL_FETCH_NEXT)
-            return SQL_ERROR;
+        Statement *statement = reinterpret_cast<Statement*>(stmt);
+
+        if (!statement)
+            return SQL_INVALID_HANDLE;
+
+        statement->FetchScroll(orientation, offset);
 
-        return SQLFetch(stmt);
+        return statement->GetDiagnosticRecords().GetReturnCode();
     }
 
     SQLRETURN SQLExtendedFetch(SQLHSTMT         stmt,
@@ -617,12 +602,7 @@ namespace ignite
                                SQLLEN       bufferLen,
                                SQLLEN*      resLen)
     {
-        using namespace odbc::type_traits;
-
         using odbc::Statement;
-        using odbc::app::ApplicationDataBuffer;
-        using odbc::app::Parameter;
-        using odbc::type_traits::IsSqlTypeSupported;
 
         LOG_MSG("SQLBindParameter called: %d, %d, %d\n", paramIdx, bufferType, paramSqlType);
 
@@ -631,27 +611,7 @@ namespace ignite
         if (!statement)
             return SQL_INVALID_HANDLE;
 
-        if (ioType != SQL_PARAM_INPUT)
-            return SQL_ERROR;
-
-        if (!IsSqlTypeSupported(paramSqlType))
-            return SQL_ERROR;
-
-        IgniteSqlType driverType = ToDriverType(bufferType);
-
-        if (driverType == IGNITE_ODBC_C_TYPE_UNSUPPORTED)
-            return SQL_ERROR;
-
-        if (buffer)
-        {
-            ApplicationDataBuffer dataBuffer(driverType, buffer, bufferLen, resLen);
-
-            Parameter param(dataBuffer, paramSqlType, columnSize, decDigits);
-
-            statement->BindParameter(paramIdx, param);
-        }
-        else
-            statement->UnbindParameter(paramIdx);
+        statement->BindParameter(paramIdx, ioType, bufferType, paramSqlType, columnSize, decDigits, buffer, bufferLen, resLen);
 
         return statement->GetDiagnosticRecords().GetReturnCode();
     }
@@ -717,13 +677,13 @@ namespace ignite
     }
 
     SQLRETURN SQLDescribeCol(SQLHSTMT       stmt,
-                             SQLUSMALLINT   columnNum, 
+                             SQLUSMALLINT   columnNum,
                              SQLCHAR*       columnNameBuf,
                              SQLSMALLINT    columnNameBufLen,
                              SQLSMALLINT*   columnNameLen,
-                             SQLSMALLINT*   dataType, 
+                             SQLSMALLINT*   dataType,
                              SQLULEN*       columnSize,
-                             SQLSMALLINT*   decimalDigits, 
+                             SQLSMALLINT*   decimalDigits,
                              SQLSMALLINT*   nullable)
     {
         using odbc::Statement;

http://git-wip-us.apache.org/repos/asf/ignite/blob/9e8e9798/modules/platforms/cpp/odbc/src/statement.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/src/statement.cpp b/modules/platforms/cpp/odbc/src/statement.cpp
index 02c6dd9..09ad81c 100644
--- a/modules/platforms/cpp/odbc/src/statement.cpp
+++ b/modules/platforms/cpp/odbc/src/statement.cpp
@@ -50,26 +50,57 @@ namespace ignite
             // No-op.
         }
 
-        void Statement::BindColumn(uint16_t columnIdx, const app::ApplicationDataBuffer& buffer)
+        void Statement::BindColumn(uint16_t columnIdx, int16_t targetType, void* targetValue, SqlLen bufferLength, SqlLen* strLengthOrIndicator)
         {
-            IGNITE_ODBC_API_CALL_ALWAYS_SUCCESS;
+            IGNITE_ODBC_API_CALL(InternalBindColumn(columnIdx, targetType, targetValue, bufferLength, strLengthOrIndicator));
+        }
+
+        SqlResult Statement::InternalBindColumn(uint16_t columnIdx, int16_t targetType, void* targetValue, SqlLen bufferLength, SqlLen* strLengthOrIndicator)
+        {
+            using namespace odbc::type_traits;
+            IgniteSqlType driverType = ToDriverType(targetType);
+
+            if (driverType == IGNITE_ODBC_C_TYPE_UNSUPPORTED)
+            {
+                AddStatusRecord(odbc::SQL_STATE_HY003_INVALID_APPLICATION_BUFFER_TYPE, "The argument TargetType was not a valid data type.");
+
+                return SQL_RESULT_ERROR;
+            }
+
+            if (bufferLength < 0)
+            {
+                AddStatusRecord(odbc::SQL_STATE_HY090_INVALID_STRING_OR_BUFFER_LENGTH,
+                    "The value specified for the argument BufferLength was less than 0.");
+
+                return SQL_RESULT_ERROR;
+            }
+
+            if (targetValue || strLengthOrIndicator)
+            {
+                app::ApplicationDataBuffer dataBuffer(driverType, targetValue, bufferLength, strLengthOrIndicator);
 
+                SafeBindColumn(columnIdx, dataBuffer);
+            }
+            else
+                SafeUnbindColumn(columnIdx);
+
+            return SQL_RESULT_SUCCESS;
+        }
+
+        void Statement::SafeBindColumn(uint16_t columnIdx, const app::ApplicationDataBuffer& buffer)
+        {
             columnBindings[columnIdx] = buffer;
 
             columnBindings[columnIdx].SetPtrToOffsetPtr(&columnBindOffset);
         }
 
-        void Statement::UnbindColumn(uint16_t columnIdx)
+        void Statement::SafeUnbindColumn(uint16_t columnIdx)
         {
-            IGNITE_ODBC_API_CALL_ALWAYS_SUCCESS;
-
             columnBindings.erase(columnIdx);
         }
 
-        void Statement::UnbindAllColumns()
+        void Statement::SafeUnbindAllColumns()
         {
-            IGNITE_ODBC_API_CALL_ALWAYS_SUCCESS;
-
             columnBindings.clear();
         }
 
@@ -108,14 +139,21 @@ namespace ignite
             return SQL_RESULT_SUCCESS;
         }
 
-        void Statement::BindParameter(uint16_t paramIdx, const app::Parameter& param)
+        void Statement::BindParameter(uint16_t paramIdx, int16_t ioType, int16_t bufferType, int16_t paramSqlType,
+                                      SqlUlen columnSize, int16_t decDigits, void* buffer, SqlLen bufferLen, SqlLen* resLen)
         {
-            IGNITE_ODBC_API_CALL(InternalBindParameter(paramIdx, param));
+            IGNITE_ODBC_API_CALL(InternalBindParameter(paramIdx, ioType, bufferType, paramSqlType, columnSize, decDigits, buffer, bufferLen, resLen));
         }
 
-
-        SqlResult Statement::InternalBindParameter(uint16_t paramIdx, const app::Parameter& param)
+        SqlResult Statement::InternalBindParameter(uint16_t paramIdx, int16_t ioType, int16_t bufferType, int16_t paramSqlType,
+                                                   SqlUlen columnSize, int16_t decDigits, void* buffer, SqlLen bufferLen, SqlLen* resLen)
         {
+            using namespace odbc::type_traits;
+            using odbc::Statement;
+            using odbc::app::ApplicationDataBuffer;
+            using odbc::app::Parameter;
+            using odbc::type_traits::IsSqlTypeSupported;
+
             if (paramIdx == 0)
             {
                 AddStatusRecord(SQL_STATE_24000_INVALID_CURSOR_STATE,
@@ -124,24 +162,60 @@ namespace ignite
                 return SQL_RESULT_ERROR;
             }
 
-            paramBindings[paramIdx] = param;
+            if (ioType != SQL_PARAM_INPUT)
+            {
+                AddStatusRecord(SQL_STATE_HY105_INVALID_PARAMETER_TYPE,
+                    "The value specified for the argument InputOutputType was not SQL_PARAM_INPUT.");
 
-            paramBindings[paramIdx].GetBuffer().SetPtrToOffsetPtr(&paramBindOffset);
+                return SQL_RESULT_ERROR;
+            }
+
+            if (!IsSqlTypeSupported(paramSqlType))
+            {
+                AddStatusRecord(SQL_STATE_HYC00_OPTIONAL_FEATURE_NOT_IMPLEMENTED,
+                    "Data type is not supported.");
+
+                return SQL_RESULT_ERROR;
+            }
+
+            IgniteSqlType driverType = ToDriverType(bufferType);
+
+            if (driverType == IGNITE_ODBC_C_TYPE_UNSUPPORTED)
+            {
+                AddStatusRecord(odbc::SQL_STATE_HY003_INVALID_APPLICATION_BUFFER_TYPE,
+                    "The argument TargetType was not a valid data type.");
+
+                return SQL_RESULT_ERROR;
+            }
+
+            if (buffer)
+            {
+                ApplicationDataBuffer dataBuffer(driverType, buffer, bufferLen, resLen);
+
+                Parameter param(dataBuffer, paramSqlType, columnSize, decDigits);
+
+                SafeBindParameter(paramIdx, param);
+            }
+            else
+                SafeUnbindParameter(paramIdx);
 
             return SQL_RESULT_SUCCESS;
         }
 
-        void Statement::UnbindParameter(uint16_t paramIdx)
+        void Statement::SafeBindParameter(uint16_t paramIdx, const app::Parameter& param)
         {
-            IGNITE_ODBC_API_CALL_ALWAYS_SUCCESS;
+            paramBindings[paramIdx] = param;
 
-            paramBindings.erase(paramIdx);
+            paramBindings[paramIdx].GetBuffer().SetPtrToOffsetPtr(&paramBindOffset);
         }
 
-        void Statement::UnbindAllParameters()
+        void Statement::SafeUnbindParameter(uint16_t paramIdx)
         {
-            IGNITE_ODBC_API_CALL_ALWAYS_SUCCESS;
+            paramBindings.erase(paramIdx);
+        }
 
+        void Statement::SafeUnbindAllParameters()
+        {
             paramBindings.clear();
         }
 
@@ -536,6 +610,50 @@ namespace ignite
             return currentQuery->Execute();
         }
 
+        void Statement::FreeResources(int16_t option)
+        {
+            IGNITE_ODBC_API_CALL(InternalFreeResources(option));
+        }
+
+        SqlResult Statement::InternalFreeResources(int16_t option)
+        {
+            switch (option)
+            {
+                case SQL_DROP:
+                {
+                    AddStatusRecord(SQL_STATE_HY000_GENERAL_ERROR, "Deprecated, call SQLFreeHandle instead");
+
+                    return SQL_RESULT_ERROR;
+                }
+
+                case SQL_CLOSE:
+                {
+                    return InternalClose();
+                }
+
+                case SQL_UNBIND:
+                {
+                    SafeUnbindAllColumns();
+
+                    break;
+                }
+
+                case SQL_RESET_PARAMS:
+                {
+                    SafeUnbindAllParameters();
+
+                    break;
+                }
+
+                default:
+                {
+                    AddStatusRecord(SQL_STATE_HY092_OPTION_TYPE_OUT_OF_RANGE, "The value specified for the argument Option was invalid");
+                    return SQL_RESULT_ERROR;
+                }
+            }
+            return SQL_RESULT_SUCCESS;
+        }
+
         void Statement::Close()
         {
             IGNITE_ODBC_API_CALL(InternalClose());
@@ -545,7 +663,7 @@ namespace ignite
         {
             if (!currentQuery.get())
                 return SQL_RESULT_SUCCESS;
-            
+
             SqlResult result = currentQuery->Close();
 
             if (result == SQL_RESULT_SUCCESS)
@@ -554,6 +672,24 @@ namespace ignite
             return result;
         }
 
+        void Statement::FetchScroll(int16_t orientation, int64_t offset)
+        {
+            IGNITE_ODBC_API_CALL(InternalFetchScroll(orientation, offset));
+        }
+
+        SqlResult Statement::InternalFetchScroll(int16_t orientation, int64_t offset)
+        {
+            UNREFERENCED_PARAMETER(offset);
+
+            if (orientation != SQL_FETCH_NEXT)
+            {
+                AddStatusRecord(SQL_STATE_HY106_FETCH_TYPE_OUT_OF_RANGE, "The value specified for the argument FetchOrientation was not SQL_FETCH_NEXT.");
+                return SQL_RESULT_ERROR;
+            }
+
+            return InternalFetchRow();
+        }
+
         void Statement::FetchRow()
         {
             IGNITE_ODBC_API_CALL(InternalFetchRow());


[6/9] ignite git commit: IGNITE-3886 .NET: Fix build script to use latest build tools

Posted by yz...@apache.org.
IGNITE-3886 .NET: Fix build script to use latest build tools

This fixes C++ compilation issue with retargeted projects


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/ff0caf81
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/ff0caf81
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/ff0caf81

Branch: refs/heads/ignite-comm-balance-master
Commit: ff0caf810f3bb76f284555dd37f93706c9edf1e7
Parents: 58188e8
Author: Pavel Tupitsyn <pt...@apache.org>
Authored: Tue Jan 10 17:49:07 2017 +0300
Committer: Pavel Tupitsyn <pt...@apache.org>
Committed: Tue Jan 10 17:49:07 2017 +0300

----------------------------------------------------------------------
 modules/platforms/dotnet/build.ps1 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/ff0caf81/modules/platforms/dotnet/build.ps1
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/build.ps1 b/modules/platforms/dotnet/build.ps1
index be7e638..4b5d937 100644
--- a/modules/platforms/dotnet/build.ps1
+++ b/modules/platforms/dotnet/build.ps1
@@ -127,7 +127,7 @@ else {
 
 # 2) Build .NET
 # Detect MSBuild 4.0+
-for ($i=4; $i -le 20; $i++) {
+for ($i=20; $i -ge 4; $i--) {
     $regKey = "HKLM:\software\Microsoft\MSBuild\ToolsVersions\$i.0"
     if (Test-Path $regKey) { break }
 }


[9/9] ignite git commit: Merge remote-tracking branch 'origin/ignite-comm-balance-master' into ignite-comm-balance-master-apache

Posted by yz...@apache.org.
Merge remote-tracking branch 'origin/ignite-comm-balance-master' into ignite-comm-balance-master-apache


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/9339e915
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/9339e915
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/9339e915

Branch: refs/heads/ignite-comm-balance-master
Commit: 9339e91594e1590e94581f52cecf2bb87b93be63
Parents: 3cc6c29 54e72b1
Author: Yakov Zhdanov <yz...@gridgain.com>
Authored: Wed Jan 11 17:21:31 2017 +0300
Committer: Yakov Zhdanov <yz...@gridgain.com>
Committed: Wed Jan 11 17:21:31 2017 +0300

----------------------------------------------------------------------
 .../java/org/apache/ignite/tools/classgen/ClassesGenerator.java | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
----------------------------------------------------------------------



[5/9] ignite git commit: IGNITE-3885 .NET: Add link to Ignite.NET development page in readme.md

Posted by yz...@apache.org.
IGNITE-3885 .NET: Add link to Ignite.NET development page in readme.md


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/58188e81
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/58188e81
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/58188e81

Branch: refs/heads/ignite-comm-balance-master
Commit: 58188e81b262c26f93b29f3facd3e77f4325e359
Parents: c4d67d2
Author: Pavel Tupitsyn <pt...@apache.org>
Authored: Tue Jan 10 17:32:57 2017 +0300
Committer: Pavel Tupitsyn <pt...@apache.org>
Committed: Tue Jan 10 17:32:57 2017 +0300

----------------------------------------------------------------------
 modules/platforms/dotnet/README.md | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/58188e81/modules/platforms/dotnet/README.md
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/README.md b/modules/platforms/dotnet/README.md
index 528a219..cbdc7c9 100644
--- a/modules/platforms/dotnet/README.md
+++ b/modules/platforms/dotnet/README.md
@@ -147,4 +147,8 @@ You can find the full Apache Ignite documentation here: [Full documentation][doc
 
 [apache-homepage]: https://ignite.apache.org/
 [getting-started]: https://apacheignite-net.readme.io/docs/getting-started-2
-[docs]: https://apacheignite-net.readme.io/docs
\ No newline at end of file
+[docs]: https://apacheignite-net.readme.io/docs
+
+## Contribute to Ignite.NET
+
+See [Ignite.NET Development](https://cwiki.apache.org/confluence/display/IGNITE/Ignite.NET+Development) on wiki.
\ No newline at end of file


[4/9] ignite git commit: .NET: Fix flaky tests - improve assertions

Posted by yz...@apache.org.
.NET: Fix flaky tests - improve assertions


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/c4d67d2a
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/c4d67d2a
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/c4d67d2a

Branch: refs/heads/ignite-comm-balance-master
Commit: c4d67d2ab737c398c9158dfeb67dc979f5c052af
Parents: 87fbb27
Author: Pavel Tupitsyn <pt...@apache.org>
Authored: Tue Jan 10 16:07:36 2017 +0300
Committer: Pavel Tupitsyn <pt...@apache.org>
Committed: Tue Jan 10 16:07:36 2017 +0300

----------------------------------------------------------------------
 .../dotnet/Apache.Ignite.Core.Tests/Cache/CacheAbstractTest.cs | 2 ++
 .../platforms/dotnet/Apache.Ignite.Core.Tests/MessagingTest.cs | 6 +++++-
 2 files changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/c4d67d2a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheAbstractTest.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheAbstractTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheAbstractTest.cs
index 250f974..1239794 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheAbstractTest.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheAbstractTest.cs
@@ -309,6 +309,8 @@ namespace Apache.Ignite.Core.Tests.Cache
 
                 Ignition.Start(cfg);
             }
+
+            Assert.AreEqual(GridCount(), GetIgnite(0).GetCluster().GetNodes().Count);
         }
 
         /// <summary>

http://git-wip-us.apache.org/repos/asf/ignite/blob/c4d67d2a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/MessagingTest.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/MessagingTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/MessagingTest.cs
index 82c6742..8b57c81 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/MessagingTest.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/MessagingTest.cs
@@ -56,6 +56,8 @@ namespace Apache.Ignite.Core.Tests
             _grid1 = Ignition.Start(Configuration("config\\compute\\compute-grid1.xml"));
             _grid2 = Ignition.Start(Configuration("config\\compute\\compute-grid2.xml"));
             _grid3 = Ignition.Start(Configuration("config\\compute\\compute-grid3.xml"));
+
+            Assert.AreEqual(3, _grid1.GetCluster().GetNodes().Count);
         }
 
         /// <summary>
@@ -556,7 +558,9 @@ namespace Apache.Ignite.Core.Tests
             Func<IEnumerable<string>, IEnumerable<string>> resultFunc, int expectedRepeat)
         {
             // check if expected message count has been received; Wait returns false if there were none.
-            Assert.IsTrue(ReceivedEvent.Wait(MessageTimeout));
+            Assert.IsTrue(ReceivedEvent.Wait(MessageTimeout),
+                string.Format("expectedMessages: {0}, expectedRepeat: {1}, remaining: {2}",
+                    expectedMessages, expectedRepeat, ReceivedEvent.CurrentCount));
 
             expectedMessages = expectedMessages.SelectMany(x => Enumerable.Repeat(x, expectedRepeat));
 


[7/9] ignite git commit: Merge branches 'ignite-comm-balance-master' and 'master' of https://git-wip-us.apache.org/repos/asf/ignite into ignite-comm-balance-master-apache

Posted by yz...@apache.org.
Merge branches 'ignite-comm-balance-master' and 'master' of https://git-wip-us.apache.org/repos/asf/ignite into ignite-comm-balance-master-apache


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/8f98e625
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/8f98e625
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/8f98e625

Branch: refs/heads/ignite-comm-balance-master
Commit: 8f98e62555310cbe589487f8beede24d5cf596b9
Parents: 3fe7dfb ff0caf8
Author: Yakov Zhdanov <yz...@gridgain.com>
Authored: Wed Jan 11 13:48:21 2017 +0300
Committer: Yakov Zhdanov <yz...@gridgain.com>
Committed: Wed Jan 11 13:48:21 2017 +0300

----------------------------------------------------------------------
 .../cpp/common/project/vs/common.vcxproj        |   1 +
 .../platforms/cpp/jni/project/vs/jni.vcxproj    |   1 +
 .../cpp/odbc-test/src/api_robustness_test.cpp   | 113 +++++++-
 modules/platforms/cpp/odbc/Makefile.am          |   3 +-
 modules/platforms/cpp/odbc/include/Makefile.am  |   3 +-
 .../cpp/odbc/include/ignite/odbc/common_types.h |  29 +-
 .../ignite/odbc/config/connection_info.h        |   2 -
 .../cpp/odbc/include/ignite/odbc/log.h          | 123 ++++++++
 .../odbc/include/ignite/odbc/meta/column_meta.h |   2 -
 .../cpp/odbc/include/ignite/odbc/statement.h    | 143 +++++++---
 .../cpp/odbc/include/ignite/odbc/utility.h      |  19 +-
 .../odbc/os/linux/src/system/socket_client.cpp  |   9 +-
 .../odbc/os/win/src/system/socket_client.cpp    |   9 +-
 .../src/system/ui/dsn_configuration_window.cpp  |  18 +-
 .../cpp/odbc/os/win/src/system_dsn.cpp          |  17 +-
 .../platforms/cpp/odbc/project/vs/odbc.vcxproj  |   2 +
 .../cpp/odbc/project/vs/odbc.vcxproj.filters    |   6 +
 .../cpp/odbc/src/config/connection_info.cpp     |   3 -
 modules/platforms/cpp/odbc/src/connection.cpp   |  21 +-
 .../odbc/src/diagnostic/diagnosable_adapter.cpp |   3 +-
 .../odbc/src/diagnostic/diagnostic_record.cpp   |  38 +++
 modules/platforms/cpp/odbc/src/entry_points.cpp |  52 ++--
 modules/platforms/cpp/odbc/src/log.cpp          |  83 ++++++
 .../platforms/cpp/odbc/src/meta/column_meta.cpp |   4 -
 modules/platforms/cpp/odbc/src/odbc.cpp         | 283 ++++++++-----------
 .../odbc/src/query/column_metadata_query.cpp    |  13 +-
 .../platforms/cpp/odbc/src/query/data_query.cpp |  23 +-
 .../cpp/odbc/src/query/table_metadata_query.cpp |  12 +-
 modules/platforms/cpp/odbc/src/statement.cpp    | 187 ++++++++++--
 modules/platforms/cpp/odbc/src/utility.cpp      |  18 +-
 .../Apache.Ignite.AspNet.Tests.csproj           |   7 +-
 .../Apache.Ignite.AspNet.csproj                 |   5 +
 .../Apache.Ignite.Benchmarks.csproj             |   5 +
 .../Apache.Ignite.Core.Tests.TestDll.csproj     |   5 +
 .../Apache.Ignite.Core.Tests.csproj             |   5 +
 .../Cache/CacheAbstractTest.cs                  |   2 +
 .../Apache.Ignite.Core.Tests/MessagingTest.cs   |   6 +-
 .../Apache.Ignite.Core.Tests/TestUtils.cs       |   1 -
 .../Apache.Ignite.Core.csproj                   |  16 +-
 .../Impl/Unmanaged/UnmanagedUtils.cs            |   4 +-
 .../Apache.Ignite.EntityFramework.Tests.csproj  |   5 +
 .../Apache.Ignite.EntityFramework.csproj        |   9 +-
 .../Impl/ArrayDbDataReader.cs                   |   5 +
 .../Impl/DataReaderResult.cs                    |   2 +
 .../Impl/DbCommandInfo.cs                       |  11 +
 .../Impl/DbCommandProxy.cs                      |   1 +
 .../Apache.Ignite.Linq.csproj                   |   5 +
 .../Apache.Ignite.Log4Net.csproj                |   5 +
 .../IgniteLog4NetLogger.cs                      |  16 +-
 .../Apache.Ignite.NLog.csproj                   |   5 +
 modules/platforms/dotnet/Apache.Ignite.sln      |   3 +
 .../dotnet/Apache.Ignite/Apache.Ignite.csproj   |   5 +
 modules/platforms/dotnet/README.md              |   6 +-
 modules/platforms/dotnet/build.ps1              |   2 +-
 .../Apache.Ignite.Examples.csproj               |   3 +
 .../Apache.Ignite.ExamplesDll.csproj            |   4 +
 .../Services/MapService.cs                      |   2 -
 57 files changed, 1015 insertions(+), 370 deletions(-)
----------------------------------------------------------------------



[2/9] ignite git commit: IGNITE-4470 Added support for log file configuration via environmental variable IGNITE_ODBC_LOG_PATH

Posted by yz...@apache.org.
IGNITE-4470 Added support for log file configuration via environmental variable IGNITE_ODBC_LOG_PATH

This closes #1384


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/825fe9cd
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/825fe9cd
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/825fe9cd

Branch: refs/heads/ignite-comm-balance-master
Commit: 825fe9cd64ded64068c573d7e3c3901efae6283f
Parents: 9e8e979
Author: Sergey Kalashnikov <sk...@gridgain.com>
Authored: Tue Jan 10 15:57:05 2017 +0300
Committer: Pavel Tupitsyn <pt...@apache.org>
Committed: Tue Jan 10 15:57:05 2017 +0300

----------------------------------------------------------------------
 modules/platforms/cpp/odbc/Makefile.am          |   3 +-
 modules/platforms/cpp/odbc/include/Makefile.am  |   3 +-
 .../ignite/odbc/config/connection_info.h        |   2 -
 .../cpp/odbc/include/ignite/odbc/log.h          | 123 ++++++++++++++
 .../odbc/include/ignite/odbc/meta/column_meta.h |   2 -
 .../cpp/odbc/include/ignite/odbc/utility.h      |  19 +--
 .../odbc/os/linux/src/system/socket_client.cpp  |   9 +-
 .../odbc/os/win/src/system/socket_client.cpp    |   9 +-
 .../src/system/ui/dsn_configuration_window.cpp  |  18 +-
 .../cpp/odbc/os/win/src/system_dsn.cpp          |  17 +-
 .../platforms/cpp/odbc/project/vs/odbc.vcxproj  |   2 +
 .../cpp/odbc/project/vs/odbc.vcxproj.filters    |   6 +
 .../cpp/odbc/src/config/connection_info.cpp     |   3 -
 modules/platforms/cpp/odbc/src/connection.cpp   |  19 ++-
 .../odbc/src/diagnostic/diagnosable_adapter.cpp |   3 +-
 modules/platforms/cpp/odbc/src/entry_points.cpp |  52 +++---
 modules/platforms/cpp/odbc/src/log.cpp          |  83 +++++++++
 .../platforms/cpp/odbc/src/meta/column_meta.cpp |   4 -
 modules/platforms/cpp/odbc/src/odbc.cpp         | 167 ++++++++++---------
 .../odbc/src/query/column_metadata_query.cpp    |  13 +-
 .../platforms/cpp/odbc/src/query/data_query.cpp |  23 ++-
 .../cpp/odbc/src/query/table_metadata_query.cpp |  12 +-
 modules/platforms/cpp/odbc/src/statement.cpp    |  11 +-
 modules/platforms/cpp/odbc/src/utility.cpp      |  18 +-
 24 files changed, 412 insertions(+), 209 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/825fe9cd/modules/platforms/cpp/odbc/Makefile.am
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/Makefile.am b/modules/platforms/cpp/odbc/Makefile.am
index 1eb42d1..de6f75a 100644
--- a/modules/platforms/cpp/odbc/Makefile.am
+++ b/modules/platforms/cpp/odbc/Makefile.am
@@ -79,7 +79,8 @@ libignite_odbc_la_SOURCES = \
     src/column.cpp \
     src/statement.cpp \
     src/type_traits.cpp \
-    src/utility.cpp
+    src/utility.cpp \
+    src/log.cpp
 
 clean-local:
 	$(RM) *.gcno *.gcda

http://git-wip-us.apache.org/repos/asf/ignite/blob/825fe9cd/modules/platforms/cpp/odbc/include/Makefile.am
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/include/Makefile.am b/modules/platforms/cpp/odbc/include/Makefile.am
index 073dcaa..36d8e25 100644
--- a/modules/platforms/cpp/odbc/include/Makefile.am
+++ b/modules/platforms/cpp/odbc/include/Makefile.am
@@ -53,7 +53,8 @@ noinst_HEADERS = \
     ignite/odbc/cursor.h \
     ignite/odbc/common_types.h \
     ignite/odbc/result_page.h \
-    ignite/odbc/type_traits.h
+    ignite/odbc/type_traits.h \
+    ignite/odbc/log.h
 
 uninstall-hook:
 	if [ -d ${includedir}/ignite ]; then find ${includedir}/ignite -type d -empty -delete; fi

http://git-wip-us.apache.org/repos/asf/ignite/blob/825fe9cd/modules/platforms/cpp/odbc/include/ignite/odbc/config/connection_info.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/include/ignite/odbc/config/connection_info.h b/modules/platforms/cpp/odbc/include/ignite/odbc/config/connection_info.h
index e0ed152..d421952 100644
--- a/modules/platforms/cpp/odbc/include/ignite/odbc/config/connection_info.h
+++ b/modules/platforms/cpp/odbc/include/ignite/odbc/config/connection_info.h
@@ -40,7 +40,6 @@ namespace ignite
                 /** Info type. */
                 typedef unsigned short InfoType;
 
-#ifdef ODBC_DEBUG
                 /**
                  * Convert type to string containing its name.
                  * Debug function.
@@ -48,7 +47,6 @@ namespace ignite
                  * @return Null-terminated string containing types name.
                  */
                 static const char* InfoTypeToString(InfoType type);
-#endif
 
                 /**
                  * Constructor.

http://git-wip-us.apache.org/repos/asf/ignite/blob/825fe9cd/modules/platforms/cpp/odbc/include/ignite/odbc/log.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/include/ignite/odbc/log.h b/modules/platforms/cpp/odbc/include/ignite/odbc/log.h
new file mode 100644
index 0000000..5a6dafc
--- /dev/null
+++ b/modules/platforms/cpp/odbc/include/ignite/odbc/log.h
@@ -0,0 +1,123 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _IGNITE_ODBC_LOG
+#define _IGNITE_ODBC_LOG
+
+#include <string>
+#include <sstream>
+#include <fstream>
+
+#include "ignite/common/common.h"
+#include "ignite/common/concurrent.h"
+
+#   define LOG_MSG(param)                                      \
+    if (ignite::odbc::Logger* p = ignite::odbc::Logger::Get()) \
+    {                                                          \
+        ignite::odbc::LogStream lstream(p);                    \
+        lstream << __FUNCTION__ << ": " << param;              \
+    }
+
+namespace ignite
+{
+    namespace odbc
+    {
+        /* Forward declaration */
+        class Logger;
+
+        /**
+         * Helper object providing stream operations for single log line.
+         * Writes resulting string to Logger object upon destruction.
+         */
+        class LogStream: public std::basic_ostream<char>
+        {
+        public:
+            /**
+             * Constructor.
+             * @param parent pointer to Logger.
+             */
+            LogStream(Logger* parent);
+
+            /**
+             * Conversion operator helpful to determine if log is enabled
+             * @return True if logger is enabled
+             */
+            bool operator()();
+
+            /**
+             * Destructor.
+             */
+            virtual ~LogStream();
+
+        private:
+            IGNITE_NO_COPY_ASSIGNMENT(LogStream);
+
+            /** String buffer. */
+            std::basic_stringbuf<char> strbuf;
+
+            /** Parent logger object */
+            Logger* logger;
+        };
+
+        /**
+         * Logging facility.
+         */
+        class Logger
+        {
+        public:
+            /**
+             * Get instance of Logger, if enabled.
+             * @return Logger instance if logging is enabled. Null otherwise.
+             */
+            static Logger* Get();
+
+            /**
+             * Checks if logging is enabled.
+             * @return True, if logging is enabled.
+             */
+            bool IsEnabled() const;
+
+            /**
+             * Outputs the message to log file
+             * @param message The message to write
+             */
+            void WriteMessage(std::string const& message);
+
+        private:
+            /**
+             * Constructor.
+             * @param path to log file.
+             */
+            Logger(const char* path);
+
+            /**
+             * Destructor.
+             */
+            ~Logger();
+
+            IGNITE_NO_COPY_ASSIGNMENT(Logger);
+
+            /** Mutex for writes synchronization. */
+            ignite::common::concurrent::CriticalSection mutex;
+
+            /** File stream. */
+            std::ofstream stream;
+        };
+    }
+}
+
+#endif //_IGNITE_ODBC_LOG

http://git-wip-us.apache.org/repos/asf/ignite/blob/825fe9cd/modules/platforms/cpp/odbc/include/ignite/odbc/meta/column_meta.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/include/ignite/odbc/meta/column_meta.h b/modules/platforms/cpp/odbc/include/ignite/odbc/meta/column_meta.h
index 5ffff03..6a94b04 100644
--- a/modules/platforms/cpp/odbc/include/ignite/odbc/meta/column_meta.h
+++ b/modules/platforms/cpp/odbc/include/ignite/odbc/meta/column_meta.h
@@ -38,7 +38,6 @@ namespace ignite
             class ColumnMeta
             {
             public:
-#ifdef ODBC_DEBUG
                 /**
                  * Convert attribute ID to string containing its name.
                  * Debug function.
@@ -46,7 +45,6 @@ namespace ignite
                  * @return Null-terminated string containing attribute name.
                  */
                 static const char* AttrIdToString(uint16_t id);
-#endif
 
                 /**
                  * Default constructor.

http://git-wip-us.apache.org/repos/asf/ignite/blob/825fe9cd/modules/platforms/cpp/odbc/include/ignite/odbc/utility.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/include/ignite/odbc/utility.h b/modules/platforms/cpp/odbc/include/ignite/odbc/utility.h
index 590e97c..7ff5b23 100644
--- a/modules/platforms/cpp/odbc/include/ignite/odbc/utility.h
+++ b/modules/platforms/cpp/odbc/include/ignite/odbc/utility.h
@@ -27,6 +27,7 @@
 
 #include <string>
 #include <algorithm>
+#include <sstream>
 
 #include <ignite/common/utils.h>
 #include <ignite/common/decimal.h>
@@ -34,22 +35,6 @@
 #include "ignite/impl/binary/binary_reader_impl.h"
 #include "ignite/impl/binary/binary_writer_impl.h"
 
-
-#ifdef ODBC_DEBUG
-
-extern FILE* log_file;
-void logInit(const char*);
-
-#   define LOG_MSG(fmt, ...)                                        \
-    do {                                                            \
-        logInit(ODBC_LOG_PATH);                                     \
-        fprintf(log_file, "%s: " fmt, __FUNCTION__, ##__VA_ARGS__);   \
-        fflush(log_file);                                           \
-    } while (false)
-#else
-#   define LOG_MSG(...)
-#endif
-
 namespace ignite
 {
     namespace utility
@@ -187,7 +172,7 @@ namespace ignite
          * @param count data length
          * @return standard string containing the formated hex dump
          */
-        std::string HexDump(const char* data, size_t count);
+        std::string HexDump(const void* data, size_t count);
     }
 }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/825fe9cd/modules/platforms/cpp/odbc/os/linux/src/system/socket_client.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/os/linux/src/system/socket_client.cpp b/modules/platforms/cpp/odbc/os/linux/src/system/socket_client.cpp
index a355625..9bdf1d7 100644
--- a/modules/platforms/cpp/odbc/os/linux/src/system/socket_client.cpp
+++ b/modules/platforms/cpp/odbc/os/linux/src/system/socket_client.cpp
@@ -27,6 +27,7 @@
 
 #include "ignite/odbc/system/socket_client.h"
 #include "ignite/odbc/utility.h"
+#include "ignite/odbc/log.h"
 
 #define SOCKET_ERROR (-1)
 
@@ -49,7 +50,7 @@ namespace ignite
 
             bool SocketClient::Connect(const char* hostname, uint16_t port)
             {
-                LOG_MSG("Host: %s, port: %d\n", hostname, port);
+                LOG_MSG("Host: " << hostname << ", port: " << port);
 
                 addrinfo hints;
                 memset(&hints, 0, sizeof(hints));
@@ -70,8 +71,10 @@ namespace ignite
                 // Attempt to connect to an address until one succeeds
                 for (addrinfo *it = result; it != NULL; it = it->ai_next) 
                 {
-                    LOG_MSG("Addr: %u.%u.%u.%u\n", it->ai_addr->sa_data[2], it->ai_addr->sa_data[3],
-                                                   it->ai_addr->sa_data[4], it->ai_addr->sa_data[5]);
+                    LOG_MSG("Addr: " << it->ai_addr->sa_data[2] << "."
+                                     << it->ai_addr->sa_data[3] << "."
+                                     << it->ai_addr->sa_data[4] << "."
+                                     << it->ai_addr->sa_data[5]);
 
                     // Create a SOCKET for connecting to server
                     socketHandle = socket(it->ai_family, it->ai_socktype, it->ai_protocol);

http://git-wip-us.apache.org/repos/asf/ignite/blob/825fe9cd/modules/platforms/cpp/odbc/os/win/src/system/socket_client.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/os/win/src/system/socket_client.cpp b/modules/platforms/cpp/odbc/os/win/src/system/socket_client.cpp
index e248323..4c440e2 100644
--- a/modules/platforms/cpp/odbc/os/win/src/system/socket_client.cpp
+++ b/modules/platforms/cpp/odbc/os/win/src/system/socket_client.cpp
@@ -28,6 +28,7 @@
 
 #include "ignite/odbc/system/socket_client.h"
 #include "ignite/odbc/utility.h"
+#include "ignite/odbc/log.h"
 
 namespace ignite
 {
@@ -64,7 +65,7 @@ namespace ignite
                 addrinfo *result = NULL;
                 addrinfo hints;
 
-                LOG_MSG("Host: %s, port: %d\n", hostname, port);
+                LOG_MSG("Host: " << hostname << " port: " << port);
 
                 memset(&hints, 0, sizeof(hints));
                 hints.ai_family = AF_UNSPEC;
@@ -83,8 +84,10 @@ namespace ignite
                 // Attempt to connect to an address until one succeeds
                 for (addrinfo *it = result; it != NULL; it = it->ai_next)
                 {
-                    LOG_MSG("Addr: %u.%u.%u.%u\n", it->ai_addr->sa_data[2] & 0xFF, it->ai_addr->sa_data[3] & 0xFF,
-                                                   it->ai_addr->sa_data[4] & 0xFF, it->ai_addr->sa_data[5] & 0xFF);
+                    LOG_MSG("Addr: " << (it->ai_addr->sa_data[2] & 0xFF) << "."
+                                     << (it->ai_addr->sa_data[3] & 0xFF) << "."
+                                     << (it->ai_addr->sa_data[4] & 0xFF) << "."
+                                     << (it->ai_addr->sa_data[5] & 0xFF));
 
                     // Create a SOCKET for connecting to server
                     socketHandle = socket(it->ai_family, it->ai_socktype, it->ai_protocol);

http://git-wip-us.apache.org/repos/asf/ignite/blob/825fe9cd/modules/platforms/cpp/odbc/os/win/src/system/ui/dsn_configuration_window.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/os/win/src/system/ui/dsn_configuration_window.cpp b/modules/platforms/cpp/odbc/os/win/src/system/ui/dsn_configuration_window.cpp
index a758bd9..864ca85 100644
--- a/modules/platforms/cpp/odbc/os/win/src/system/ui/dsn_configuration_window.cpp
+++ b/modules/platforms/cpp/odbc/os/win/src/system/ui/dsn_configuration_window.cpp
@@ -17,6 +17,8 @@
 
 #include <Windowsx.h>
 
+#include "ignite/odbc/log.h"
+
 #include "ignite/odbc/system/ui/dsn_configuration_window.h"
 
 namespace ignite
@@ -300,14 +302,14 @@ namespace ignite
                     distributedJoins = distributedJoinsCheckBox->IsEnabled() && distributedJoinsCheckBox->IsChecked();
                     enforceJoinOrder = enforceJoinOrderCheckBox->IsEnabled() && enforceJoinOrderCheckBox->IsChecked();
 
-                    LOG_MSG("Retriving arguments:\n");
-                    LOG_MSG("DSN:                %s\n", dsn.c_str());
-                    LOG_MSG("Address:            %s\n", address.c_str());
-                    LOG_MSG("Cache:              %s\n", cache.c_str());
-                    LOG_MSG("Page size:          %d\n", pageSize);
-                    LOG_MSG("Protocol version:   %s\n", version.c_str());
-                    LOG_MSG("Distributed Joins:  %s\n", distributedJoins ? "true" : "false");
-                    LOG_MSG("Enforce Join Order: %s\n", enforceJoinOrder ? "true" : "false");
+                    LOG_MSG("Retriving arguments:");
+                    LOG_MSG("DSN:                " << dsn);
+                    LOG_MSG("Address:            " << address);
+                    LOG_MSG("Cache:              " << cache);
+                    LOG_MSG("Page size:          " << pageSize);
+                    LOG_MSG("Protocol version:   " << version);
+                    LOG_MSG("Distributed Joins:  " << (distributedJoins ? "true" : "false"));
+                    LOG_MSG("Enforce Join Order: " << (enforceJoinOrder ? "true" : "false"));
 
                     if (dsn.empty())
                         throw IgniteError(IgniteError::IGNITE_ERR_GENERIC, "DSN name can not be empty.");

http://git-wip-us.apache.org/repos/asf/ignite/blob/825fe9cd/modules/platforms/cpp/odbc/os/win/src/system_dsn.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/os/win/src/system_dsn.cpp b/modules/platforms/cpp/odbc/os/win/src/system_dsn.cpp
index f432a40..3d41e3e 100644
--- a/modules/platforms/cpp/odbc/os/win/src/system_dsn.cpp
+++ b/modules/platforms/cpp/odbc/os/win/src/system_dsn.cpp
@@ -16,6 +16,7 @@
  */
 
 #include "ignite/odbc/utility.h"
+#include "ignite/odbc/log.h"
 #include "ignite/odbc/system/odbc_constants.h"
 
 #include "ignite/odbc/dsn_config.h"
@@ -147,27 +148,27 @@ BOOL INSTAPI ConfigDSN(HWND hwndParent, WORD req, LPCSTR driver, LPCSTR attribut
 {
     using namespace ignite::odbc;
 
-    LOG_MSG("ConfigDSN called\n");
+    LOG_MSG("ConfigDSN called");
 
     Configuration config;
 
-    LOG_MSG("Attributes: %s\n", attributes);
+    LOG_MSG("Attributes: " << attributes);
 
     config.FillFromConfigAttributes(attributes);
 
     if (!SQLValidDSN(config.GetDsn().c_str()))
         return FALSE;
 
-    LOG_MSG("Driver: %s\n", driver);
-    LOG_MSG("Attributes: %s\n", attributes);
+    LOG_MSG("Driver: " << driver);
+    LOG_MSG("Attributes: " << attributes);
 
-    LOG_MSG("DSN: %s\n", config.GetDsn().c_str());
+    LOG_MSG("DSN: " << config.GetDsn());
 
     switch (req)
     {
         case ODBC_ADD_DSN:
         {
-            LOG_MSG("ODBC_ADD_DSN\n");
+            LOG_MSG("ODBC_ADD_DSN");
 
             if (!DisplayConfigureDsnWindow(hwndParent, config))
                 return FALSE;
@@ -180,7 +181,7 @@ BOOL INSTAPI ConfigDSN(HWND hwndParent, WORD req, LPCSTR driver, LPCSTR attribut
 
         case ODBC_CONFIG_DSN:
         {
-            LOG_MSG("ODBC_CONFIG_DSN\n");
+            LOG_MSG("ODBC_CONFIG_DSN");
 
             std::string dsn = config.GetDsn();
 
@@ -202,7 +203,7 @@ BOOL INSTAPI ConfigDSN(HWND hwndParent, WORD req, LPCSTR driver, LPCSTR attribut
 
         case ODBC_REMOVE_DSN:
         {
-            LOG_MSG("ODBC_REMOVE_DSN\n");
+            LOG_MSG("ODBC_REMOVE_DSN");
 
             if (!UnregisterDsn(config.GetDsn().c_str()))
                 return FALSE;

http://git-wip-us.apache.org/repos/asf/ignite/blob/825fe9cd/modules/platforms/cpp/odbc/project/vs/odbc.vcxproj
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/project/vs/odbc.vcxproj b/modules/platforms/cpp/odbc/project/vs/odbc.vcxproj
index 56358c5..b00e432 100644
--- a/modules/platforms/cpp/odbc/project/vs/odbc.vcxproj
+++ b/modules/platforms/cpp/odbc/project/vs/odbc.vcxproj
@@ -188,6 +188,7 @@
     <ClCompile Include="..\..\src\statement.cpp" />
     <ClCompile Include="..\..\src\type_traits.cpp" />
     <ClCompile Include="..\..\src\utility.cpp" />
+    <ClCompile Include="..\..\src\log.cpp" />
   </ItemGroup>
   <ItemGroup>
     <None Include="module.def" />
@@ -230,6 +231,7 @@
     <ClInclude Include="..\..\include\ignite\odbc\system\ui\dsn_configuration_window.h" />
     <ClInclude Include="..\..\include\ignite\odbc\type_traits.h" />
     <ClInclude Include="..\..\include\ignite\odbc\utility.h" />
+    <ClInclude Include="..\..\include\ignite\odbc\log.h" />
     <ClInclude Include="..\..\os\win\include\ignite\odbc\system\ui\custom_window.h" />
     <ClInclude Include="..\..\os\win\include\ignite\odbc\system\ui\window.h" />
   </ItemGroup>

http://git-wip-us.apache.org/repos/asf/ignite/blob/825fe9cd/modules/platforms/cpp/odbc/project/vs/odbc.vcxproj.filters
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/project/vs/odbc.vcxproj.filters b/modules/platforms/cpp/odbc/project/vs/odbc.vcxproj.filters
index 58764e4..1828be1 100644
--- a/modules/platforms/cpp/odbc/project/vs/odbc.vcxproj.filters
+++ b/modules/platforms/cpp/odbc/project/vs/odbc.vcxproj.filters
@@ -52,6 +52,9 @@
     <ClCompile Include="..\..\src\utility.cpp">
       <Filter>Code</Filter>
     </ClCompile>
+    <ClCompile Include="..\..\src\log.cpp">
+      <Filter>Code</Filter>
+    </ClCompile>
     <ClCompile Include="..\..\src\cursor.cpp">
       <Filter>Code</Filter>
     </ClCompile>
@@ -176,6 +179,9 @@
     <ClInclude Include="..\..\include\ignite\odbc\utility.h">
       <Filter>Code</Filter>
     </ClInclude>
+    <ClInclude Include="..\..\include\ignite\odbc\log.h">
+      <Filter>Code</Filter>
+    </ClInclude>
     <ClInclude Include="..\..\include\ignite\odbc\query\query.h">
       <Filter>Code\query</Filter>
     </ClInclude>

http://git-wip-us.apache.org/repos/asf/ignite/blob/825fe9cd/modules/platforms/cpp/odbc/src/config/connection_info.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/src/config/connection_info.cpp b/modules/platforms/cpp/odbc/src/config/connection_info.cpp
index 7c612bc..ed76aab 100644
--- a/modules/platforms/cpp/odbc/src/config/connection_info.cpp
+++ b/modules/platforms/cpp/odbc/src/config/connection_info.cpp
@@ -42,8 +42,6 @@ namespace ignite
         namespace config
         {
 
-#ifdef ODBC_DEBUG
-
 #define DBG_STR_CASE(x) case x: return #x
 
             const char * ConnectionInfo::InfoTypeToString(InfoType type)
@@ -102,7 +100,6 @@ namespace ignite
             }
 
 #undef DBG_STR_CASE
-#endif
 
             ConnectionInfo::ConnectionInfo() : strParams(), intParams(),
                 shortParams()

http://git-wip-us.apache.org/repos/asf/ignite/blob/825fe9cd/modules/platforms/cpp/odbc/src/connection.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/src/connection.cpp b/modules/platforms/cpp/odbc/src/connection.cpp
index 4a6de5e..960a507 100644
--- a/modules/platforms/cpp/odbc/src/connection.cpp
+++ b/modules/platforms/cpp/odbc/src/connection.cpp
@@ -21,6 +21,7 @@
 
 #include <ignite/common/fixed_size_array.h>
 
+#include "ignite/odbc/log.h"
 #include "ignite/odbc/utility.h"
 #include "ignite/odbc/statement.h"
 #include "ignite/odbc/connection.h"
@@ -65,6 +66,13 @@ namespace ignite
 
         void Connection::GetInfo(config::ConnectionInfo::InfoType type, void* buf, short buflen, short* reslen)
         {
+            LOG_MSG("SQLGetInfo called: "
+                << type << " ("
+                << config::ConnectionInfo::InfoTypeToString(type) << "), "
+                << std::hex << reinterpret_cast<size_t>(buf) << ", "
+                << buflen << ", "
+                << std::hex << reinterpret_cast<size_t>(reslen));
+
             IGNITE_ODBC_API_CALL(InternalGetInfo(type, buf, buflen, reslen));
         }
 
@@ -195,7 +203,7 @@ namespace ignite
             if (sent != len + sizeof(OdbcProtocolHeader))
                 IGNITE_ERROR_1(IgniteError::IGNITE_ERR_GENERIC, "Can not send message");
 
-            LOG_MSG("message sent: (%d bytes)%s\n", msg.GetSize(), utility::HexDump((char*)msg.GetData(), msg.GetSize()).c_str());
+            LOG_MSG("message sent: (" <<  msg.GetSize() << " bytes)" << utility::HexDump(msg.GetData(), msg.GetSize()));
         }
 
         size_t Connection::SendAll(const int8_t* data, size_t len)
@@ -206,7 +214,7 @@ namespace ignite
             {
                 int res = socket.Send(data + sent, len - sent);
 
-                LOG_MSG("Sent: %d\n", res);
+                LOG_MSG("Sent: " << res);
 
                 if (res <= 0)
                     return sent;
@@ -259,8 +267,7 @@ namespace ignite
                 size_t received = len - remain;
 
                 int res = socket.Receive(buffer + received, remain);
-                LOG_MSG("Receive res: %d\n", res);
-                LOG_MSG("remain: %d\n", remain);
+                LOG_MSG("Receive res: " << res << " remain: " << remain);
 
                 if (res <= 0)
                     return received;
@@ -345,7 +352,7 @@ namespace ignite
 
             if (rsp.GetStatus() != RESPONSE_STATUS_SUCCESS)
             {
-                LOG_MSG("Error: %s\n", rsp.GetError().c_str());
+                LOG_MSG("Error: " << rsp.GetError().c_str());
 
                 AddStatusRecord(SQL_STATE_08001_CANNOT_CONNECT, rsp.GetError());
 
@@ -356,7 +363,7 @@ namespace ignite
 
             if (!rsp.IsAccepted())
             {
-                LOG_MSG("Hanshake message has been rejected.\n");
+                LOG_MSG("Hanshake message has been rejected.");
 
                 std::stringstream constructor;
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/825fe9cd/modules/platforms/cpp/odbc/src/diagnostic/diagnosable_adapter.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/src/diagnostic/diagnosable_adapter.cpp b/modules/platforms/cpp/odbc/src/diagnostic/diagnosable_adapter.cpp
index 260e3e4..94ea53e 100644
--- a/modules/platforms/cpp/odbc/src/diagnostic/diagnosable_adapter.cpp
+++ b/modules/platforms/cpp/odbc/src/diagnostic/diagnosable_adapter.cpp
@@ -15,6 +15,7 @@
  * limitations under the License.
  */
 
+#include "ignite/odbc/log.h"
 #include "ignite/odbc/connection.h"
 #include "ignite/odbc/diagnostic/diagnosable_adapter.h"
 
@@ -41,7 +42,7 @@ namespace ignite
 
             void DiagnosableAdapter::AddStatusRecord(SqlState sqlState, const std::string& message)
             {
-                LOG_MSG("Adding new record: %s\n", message.c_str());
+                LOG_MSG("Adding new record: " << message);
 
                 AddStatusRecord(sqlState, message, 0, 0);
             }

http://git-wip-us.apache.org/repos/asf/ignite/blob/825fe9cd/modules/platforms/cpp/odbc/src/entry_points.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/src/entry_points.cpp b/modules/platforms/cpp/odbc/src/entry_points.cpp
index 850fa10..e241a9f 100644
--- a/modules/platforms/cpp/odbc/src/entry_points.cpp
+++ b/modules/platforms/cpp/odbc/src/entry_points.cpp
@@ -17,6 +17,8 @@
 
 #include "ignite/odbc.h"
 
+#include "ignite/odbc/log.h"
+
 #include "ignite/odbc/utility.h"
 
 SQLRETURN SQL_API SQLGetInfo(SQLHDBC        conn,
@@ -440,7 +442,7 @@ SQLRETURN SQL_API SQLError(SQLHENV      env,
 
 SQLRETURN SQL_API SQLCancel(SQLHSTMT stmt)
 {
-    LOG_MSG("SQLCancel called\n");
+    LOG_MSG("SQLCancel called");
     return SQL_SUCCESS;
 }
 
@@ -452,7 +454,7 @@ SQLRETURN SQL_API SQLColAttributes(SQLHSTMT     stmt,
                                    SQLSMALLINT* strAttrResLen,
                                    SQLLEN*      numAttrBuf)
 {
-    LOG_MSG("SQLColAttributes called\n");
+    LOG_MSG("SQLColAttributes called");
     return SQL_SUCCESS;
 }
 
@@ -461,7 +463,7 @@ SQLRETURN SQL_API SQLGetCursorName(SQLHSTMT     stmt,
                                    SQLSMALLINT  nameBufLen,
                                    SQLSMALLINT* nameResLen)
 {
-    LOG_MSG("SQLGetCursorName called\n");
+    LOG_MSG("SQLGetCursorName called");
     return SQL_SUCCESS;
 }
 
@@ -469,7 +471,7 @@ SQLRETURN SQL_API SQLSetCursorName(SQLHSTMT     stmt,
                                    SQLCHAR*     name,
                                    SQLSMALLINT  nameLen)
 {
-    LOG_MSG("SQLSetCursorName called\n");
+    LOG_MSG("SQLSetCursorName called");
     return SQL_SUCCESS;
 }
 
@@ -477,7 +479,7 @@ SQLRETURN SQL_API SQLGetConnectOption(SQLHDBC       conn,
                                       SQLUSMALLINT  option,
                                       SQLPOINTER    value)
 {
-    LOG_MSG("SQLGetConnectOption called\n");
+    LOG_MSG("SQLGetConnectOption called");
     return SQL_SUCCESS;
 }
 
@@ -485,7 +487,7 @@ SQLRETURN SQL_API SQLGetStmtOption(SQLHSTMT     stmt,
                                    SQLUSMALLINT option,
                                    SQLPOINTER   value)
 {
-    LOG_MSG("SQLGetStmtOption called\n");
+    LOG_MSG("SQLGetStmtOption called");
     return SQL_SUCCESS;
 }
 
@@ -493,7 +495,7 @@ SQLRETURN SQL_API SQLSetConnectOption(SQLHDBC       conn,
                                       SQLUSMALLINT  option,
                                       SQLULEN       value)
 {
-    LOG_MSG("SQLSetConnectOption called\n");
+    LOG_MSG("SQLSetConnectOption called");
     return SQL_SUCCESS;
 }
 
@@ -501,7 +503,7 @@ SQLRETURN SQL_API SQLSetStmtOption(SQLHSTMT     stmt,
                                    SQLUSMALLINT option,
                                    SQLULEN      value)
 {
-    LOG_MSG("SQLSetStmtOption called\n");
+    LOG_MSG("SQLSetStmtOption called");
     return SQL_SUCCESS;
 }
 
@@ -515,7 +517,7 @@ SQLRETURN SQL_API SQLStatistics(SQLHSTMT        stmt,
                                 SQLUSMALLINT    unique,
                                 SQLUSMALLINT    reserved)
 {
-    LOG_MSG("SQLStatistics called\n");
+    LOG_MSG("SQLStatistics called");
     return SQL_SUCCESS;
 }
 
@@ -526,7 +528,7 @@ SQLRETURN SQL_API SQLBrowseConnect(SQLHDBC      conn,
                                    SQLSMALLINT  outConnectionStrBufLen,
                                    SQLSMALLINT* outConnectionStrResLen)
 {
-    LOG_MSG("SQLBrowseConnect called\n");
+    LOG_MSG("SQLBrowseConnect called");
     return SQL_SUCCESS;
 }
 
@@ -540,7 +542,7 @@ SQLRETURN SQL_API SQLProcedureColumns(SQLHSTMT      stmt,
                                       SQLCHAR *     columnName,
                                       SQLSMALLINT   columnNameLen)
 {
-    LOG_MSG("SQLProcedureColumns called\n");
+    LOG_MSG("SQLProcedureColumns called");
     return SQL_SUCCESS;
 }
 
@@ -549,7 +551,7 @@ SQLRETURN SQL_API SQLSetPos(SQLHSTMT        stmt,
                             SQLUSMALLINT    operation,
                             SQLUSMALLINT    lockType)
 {
-    LOG_MSG("SQLSetPos called\n");
+    LOG_MSG("SQLSetPos called");
     return SQL_SUCCESS;
 }
 
@@ -558,7 +560,7 @@ SQLRETURN SQL_API SQLSetScrollOptions(SQLHSTMT      stmt,
                                       SQLLEN        crowKeyset,
                                       SQLUSMALLINT  crowRowset)
 {
-    LOG_MSG("SQLSetScrollOptions called\n");
+    LOG_MSG("SQLSetScrollOptions called");
     return SQL_SUCCESS;
 }
 
@@ -568,7 +570,7 @@ SQLRETURN SQL_API SQLGetConnectAttr(SQLHDBC     conn,
                                     SQLINTEGER  valueBufLen,
                                     SQLINTEGER* valueResLen)
 {
-    LOG_MSG("SQLGetConnectAttr called\n");
+    LOG_MSG("SQLGetConnectAttr called");
     return SQL_SUCCESS;
 }
 
@@ -577,14 +579,14 @@ SQLRETURN SQL_API SQLSetConnectAttr(SQLHDBC     conn,
                                     SQLPOINTER  value,
                                     SQLINTEGER  valueLen)
 {
-    LOG_MSG("SQLSetConnectAttr called\n");
+    LOG_MSG("SQLSetConnectAttr called");
     return SQL_SUCCESS;
 }
 
 SQLRETURN SQL_API SQLBulkOperations(SQLHSTMT       stmt,
                                     SQLUSMALLINT   operation)
 {
-    LOG_MSG("SQLBulkOperations called\n");
+    LOG_MSG("SQLBulkOperations called");
     return SQL_SUCCESS;
 }
 
@@ -596,13 +598,13 @@ SQLRETURN SQL_API SQLTablePrivileges(SQLHSTMT      stmt,
                                      SQLCHAR*      tableName,
                                      SQLSMALLINT   tableNameLen)
 {
-    LOG_MSG("SQLTablePrivileges called\n");
+    LOG_MSG("SQLTablePrivileges called");
     return SQL_SUCCESS;
 }
 
 SQLRETURN SQL_API SQLCopyDesc(SQLHDESC src, SQLHDESC dst)
 {
-    LOG_MSG("SQLCopyDesc called\n");
+    LOG_MSG("SQLCopyDesc called");
     return SQL_SUCCESS;
 }
 
@@ -613,7 +615,7 @@ SQLRETURN SQL_API SQLGetDescField(SQLHDESC      descr,
                                   SQLINTEGER    bufferLen,
                                   SQLINTEGER*   resLen)
 {
-    LOG_MSG("SQLGetDescField called\n");
+    LOG_MSG("SQLGetDescField called");
     return SQL_SUCCESS;
 }
 
@@ -629,7 +631,7 @@ SQLRETURN SQL_API SQLGetDescRec(SQLHDESC        DescriptorHandle,
                                 SQLSMALLINT*    scale,
                                 SQLSMALLINT*    nullable)
 {
-    LOG_MSG("SQLGetDescRec called\n");
+    LOG_MSG("SQLGetDescRec called");
     return SQL_SUCCESS;
 }
 
@@ -639,7 +641,7 @@ SQLRETURN SQL_API SQLSetDescField(SQLHDESC      descr,
                                   SQLPOINTER    buffer,
                                   SQLINTEGER    bufferLen)
 {
-    LOG_MSG("SQLSetDescField called\n");
+    LOG_MSG("SQLSetDescField called");
     return SQL_SUCCESS;
 }
 
@@ -654,7 +656,7 @@ SQLRETURN SQL_API SQLSetDescRec(SQLHDESC      descr,
                                 SQLLEN*       resLen,
                                 SQLLEN*       id)
 {
-    LOG_MSG("SQLSetDescRec called\n");
+    LOG_MSG("SQLSetDescRec called");
     return SQL_SUCCESS;
 }
 
@@ -668,7 +670,7 @@ SQLRETURN SQL_API SQLColumnPrivileges(SQLHSTMT      stmt,
                                       SQLCHAR*      columnName,
                                       SQLSMALLINT   columnNameLen)
 {
-    LOG_MSG("SQLColumnPrivileges called\n");
+    LOG_MSG("SQLColumnPrivileges called");
     return SQL_SUCCESS;
 }
 
@@ -676,7 +678,7 @@ SQLRETURN SQL_API SQLParamOptions(SQLHSTMT  stmt,
                                   SQLULEN   paramSetSize,
                                   SQLULEN*  paramsProcessed)
 {
-    LOG_MSG("SQLParamOptions called\n");
+    LOG_MSG("SQLParamOptions called");
     return SQL_SUCCESS;
 }
 
@@ -688,6 +690,6 @@ SQLRETURN SQL_API SQLProcedures(SQLHSTMT        stmt,
                                 SQLCHAR*        tableName,
                                 SQLSMALLINT     tableNameLen)
 {
-    LOG_MSG("SQLProcedures called\n");
+    LOG_MSG("SQLProcedures called");
     return SQL_SUCCESS;
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/825fe9cd/modules/platforms/cpp/odbc/src/log.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/src/log.cpp b/modules/platforms/cpp/odbc/src/log.cpp
new file mode 100644
index 0000000..755798f
--- /dev/null
+++ b/modules/platforms/cpp/odbc/src/log.cpp
@@ -0,0 +1,83 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <cstdlib>
+
+#include "ignite/odbc/log.h"
+
+namespace ignite
+{
+    namespace odbc
+    {
+        LogStream::LogStream(Logger* parent) :
+            std::basic_ostream<char>(0),
+            strbuf(),
+            logger(parent)
+        {
+            init(&strbuf);
+        }
+
+        bool LogStream::operator()()
+        {
+            return logger != 0;
+        }
+
+        LogStream::~LogStream()
+        {
+            if (logger)
+            {
+                logger->WriteMessage(strbuf.str());
+            }
+        }
+
+        Logger::Logger(const char* path) :
+            mutex(),
+            stream()
+        {
+            if (path)
+            {
+                stream.open(path);
+            }
+        }
+
+        Logger::~Logger()
+        {
+        }
+
+        bool Logger::IsEnabled() const
+        {
+            return stream.is_open();
+        }
+
+        void Logger::WriteMessage(std::string const& message)
+        {
+            if (IsEnabled())
+            {
+                ignite::common::concurrent::CsLockGuard guard(mutex);
+                stream << message << std::endl;
+            }
+        }
+
+        Logger* Logger::Get()
+        {
+            const char* envVarName = "IGNITE_ODBC_LOG_PATH";
+            static Logger logger(getenv(envVarName));
+            return logger.IsEnabled() ? &logger : 0;
+        }
+    }
+}
+

http://git-wip-us.apache.org/repos/asf/ignite/blob/825fe9cd/modules/platforms/cpp/odbc/src/meta/column_meta.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/src/meta/column_meta.cpp b/modules/platforms/cpp/odbc/src/meta/column_meta.cpp
index d397618..12dbfc1 100644
--- a/modules/platforms/cpp/odbc/src/meta/column_meta.cpp
+++ b/modules/platforms/cpp/odbc/src/meta/column_meta.cpp
@@ -27,8 +27,6 @@ namespace ignite
         namespace meta
         {
 
-#ifdef ODBC_DEBUG
-
 #define DBG_STR_CASE(x) case x: return #x
 
             const char* ColumnMeta::AttrIdToString(uint16_t id)
@@ -70,8 +68,6 @@ namespace ignite
 
 #undef DBG_STR_CASE
 
-#endif
-
             void ColumnMeta::Read(ignite::impl::binary::BinaryReaderImpl& reader)
             {
                 utility::ReadString(reader, schemaName);

http://git-wip-us.apache.org/repos/asf/ignite/blob/825fe9cd/modules/platforms/cpp/odbc/src/odbc.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/src/odbc.cpp b/modules/platforms/cpp/odbc/src/odbc.cpp
index fd69c0d..542e64c 100644
--- a/modules/platforms/cpp/odbc/src/odbc.cpp
+++ b/modules/platforms/cpp/odbc/src/odbc.cpp
@@ -20,6 +20,7 @@
 #include <cstring>
 #include <algorithm>
 
+#include "ignite/odbc/log.h"
 #include "ignite/odbc/utility.h"
 #include "ignite/odbc/system/odbc_constants.h"
 
@@ -43,9 +44,10 @@ namespace ignite
         using odbc::Connection;
         using odbc::config::ConnectionInfo;
 
-        LOG_MSG("SQLGetInfo called: %d (%s), %p, %d, %p\n",
-                infoType, ConnectionInfo::InfoTypeToString(infoType),
-                infoValue, infoValueMax, length);
+        LOG_MSG("SQLGetInfo called: "
+            << infoType << " (" << ConnectionInfo::InfoTypeToString(infoType) << "), "
+            << std::hex << reinterpret_cast<size_t>(infoValue) << ", " << infoValueMax << ", "
+            << std::hex << reinterpret_cast<size_t>(length));
 
         Connection *connection = reinterpret_cast<Connection*>(conn);
 
@@ -59,7 +61,7 @@ namespace ignite
 
     SQLRETURN SQLAllocHandle(SQLSMALLINT type, SQLHANDLE parent, SQLHANDLE* result)
     {
-        //LOG_MSG("SQLAllocHandle called\n");
+        //LOG_MSG("SQLAllocHandle called");
         switch (type)
         {
             case SQL_HANDLE_ENV:
@@ -101,7 +103,7 @@ namespace ignite
     {
         using odbc::Environment;
 
-        LOG_MSG("SQLAllocEnv called\n");
+        LOG_MSG("SQLAllocEnv called");
 
         *env = reinterpret_cast<SQLHENV>(new Environment());
 
@@ -113,7 +115,7 @@ namespace ignite
         using odbc::Environment;
         using odbc::Connection;
 
-        LOG_MSG("SQLAllocConnect called\n");
+        LOG_MSG("SQLAllocConnect called");
 
         *conn = SQL_NULL_HDBC;
 
@@ -137,7 +139,7 @@ namespace ignite
         using odbc::Connection;
         using odbc::Statement;
 
-        LOG_MSG("SQLAllocStmt called\n");
+        LOG_MSG("SQLAllocStmt called");
 
         *stmt = SQL_NULL_HDBC;
 
@@ -178,7 +180,7 @@ namespace ignite
     {
         using odbc::Environment;
 
-        LOG_MSG("SQLFreeEnv called\n");
+        LOG_MSG("SQLFreeEnv called");
 
         Environment *environment = reinterpret_cast<Environment*>(env);
 
@@ -194,7 +196,7 @@ namespace ignite
     {
         using odbc::Connection;
 
-        LOG_MSG("SQLFreeConnect called\n");
+        LOG_MSG("SQLFreeConnect called");
 
         Connection *connection = reinterpret_cast<Connection*>(conn);
 
@@ -210,7 +212,7 @@ namespace ignite
     {
         using odbc::Statement;
 
-        LOG_MSG("SQLFreeStmt called\n");
+        LOG_MSG("SQLFreeStmt called");
 
         Statement *statement = reinterpret_cast<Statement*>(stmt);
 
@@ -232,7 +234,7 @@ namespace ignite
     {
         using odbc::Statement;
 
-        LOG_MSG("SQLCloseCursor called\n");
+        LOG_MSG("SQLCloseCursor called");
 
         Statement *statement = reinterpret_cast<Statement*>(stmt);
 
@@ -257,8 +259,9 @@ namespace ignite
 
         UNREFERENCED_PARAMETER(windowHandle);
 
-        LOG_MSG("SQLDriverConnect called\n");
-        LOG_MSG("Connection String: [%s]\n", inConnectionString);
+        LOG_MSG("SQLDriverConnect called");
+        if (inConnectionString)
+            LOG_MSG("Connection String: [" << inConnectionString << "]");
 
         Connection *connection = reinterpret_cast<Connection*>(conn);
 
@@ -290,7 +293,8 @@ namespace ignite
         if (outConnectionStringLen)
             *outConnectionStringLen = static_cast<SQLSMALLINT>(reslen);
 
-        LOG_MSG("%s\n", outConnectionString);
+        if (outConnectionString)
+            LOG_MSG(outConnectionString);
 
         return diag.GetReturnCode();
     }
@@ -318,7 +322,7 @@ namespace ignite
 
         std::string dsn = SqlStringToString(serverName, serverNameLen);
 
-        LOG_MSG("DSN: %s\n", dsn.c_str());
+        LOG_MSG("DSN: " << dsn);
 
         odbc::ReadDsnConfiguration(dsn.c_str(), config);
 
@@ -331,7 +335,7 @@ namespace ignite
     {
         using odbc::Connection;
 
-        LOG_MSG("SQLDisconnect called\n");
+        LOG_MSG("SQLDisconnect called");
 
         Connection *connection = reinterpret_cast<Connection*>(conn);
 
@@ -348,7 +352,7 @@ namespace ignite
         using odbc::Statement;
         using utility::SqlStringToString;
 
-        LOG_MSG("SQLPrepare called\n");
+        LOG_MSG("SQLPrepare called");
 
         Statement *statement = reinterpret_cast<Statement*>(stmt);
 
@@ -357,7 +361,7 @@ namespace ignite
 
         std::string sql = SqlStringToString(query, queryLen);
 
-        LOG_MSG("SQL: %s\n", sql.c_str());
+        LOG_MSG("SQL: " << sql);
 
         statement->PrepareSqlQuery(sql);
 
@@ -368,7 +372,7 @@ namespace ignite
     {
         using odbc::Statement;
 
-        LOG_MSG("SQLExecute called\n");
+        LOG_MSG("SQLExecute called");
 
         Statement *statement = reinterpret_cast<Statement*>(stmt);
 
@@ -385,7 +389,7 @@ namespace ignite
         using odbc::Statement;
         using utility::SqlStringToString;
 
-        LOG_MSG("SQLExecDirect called\n");
+        LOG_MSG("SQLExecDirect called");
 
         Statement *statement = reinterpret_cast<Statement*>(stmt);
 
@@ -394,7 +398,7 @@ namespace ignite
 
         std::string sql = SqlStringToString(query, queryLen);
 
-        LOG_MSG("SQL: %s\n", sql.c_str());
+        LOG_MSG("SQL: " << sql);
 
         statement->ExecuteSqlQuery(sql);
 
@@ -413,7 +417,10 @@ namespace ignite
         using odbc::Statement;
         using odbc::app::ApplicationDataBuffer;
 
-        LOG_MSG("SQLBindCol called: index=%d, type=%d targetValue=%p bufferLength=%d\n", colNum, targetType, targetValue, bufferLength);
+        LOG_MSG("SQLBindCol called: index=" << colNum << ", type=" << targetType << 
+                ", targetValue=" << reinterpret_cast<size_t>(targetValue) << 
+                ", bufferLength=" << bufferLength << 
+                ", lengthInd=" << reinterpret_cast<size_t>(strLengthOrIndicator));
 
         Statement *statement = reinterpret_cast<Statement*>(stmt);
 
@@ -429,7 +436,7 @@ namespace ignite
     {
         using odbc::Statement;
 
-        LOG_MSG("SQLFetch called\n");
+        LOG_MSG("SQLFetch called");
 
         Statement *statement = reinterpret_cast<Statement*>(stmt);
 
@@ -445,8 +452,8 @@ namespace ignite
     {
         using odbc::Statement;
 
-        LOG_MSG("SQLFetchScroll called\n");
-        LOG_MSG("Orientation: %d, Offset: %d\n", orientation, offset);
+        LOG_MSG("SQLFetchScroll called");
+        LOG_MSG("Orientation: " << orientation << " Offset: " << offset);
 
         Statement *statement = reinterpret_cast<Statement*>(stmt);
 
@@ -464,7 +471,7 @@ namespace ignite
                                SQLULEN*         rowCount,
                                SQLUSMALLINT*    rowStatusArray)
     {
-        LOG_MSG("SQLExtendedFetch called\n");
+        LOG_MSG("SQLExtendedFetch called");
 
         SQLRETURN res = SQLFetchScroll(stmt, orientation, offset);
 
@@ -487,7 +494,7 @@ namespace ignite
         using odbc::Statement;
         using odbc::meta::ColumnMetaVector;
 
-        LOG_MSG("SQLNumResultCols called\n");
+        LOG_MSG("SQLNumResultCols called");
 
         Statement *statement = reinterpret_cast<Statement*>(stmt);
 
@@ -499,7 +506,7 @@ namespace ignite
         if (columnNum)
         {
             *columnNum = static_cast<SQLSMALLINT>(res);
-            LOG_MSG("columnNum: %d\n", *columnNum);
+            LOG_MSG("columnNum: " << *columnNum);
         }
 
         return statement->GetDiagnosticRecords().GetReturnCode();
@@ -518,7 +525,7 @@ namespace ignite
         using odbc::Statement;
         using utility::SqlStringToString;
 
-        LOG_MSG("SQLTables called\n");
+        LOG_MSG("SQLTables called");
 
         Statement *statement = reinterpret_cast<Statement*>(stmt);
 
@@ -530,10 +537,10 @@ namespace ignite
         std::string table = SqlStringToString(tableName, tableNameLen);
         std::string tableTypeStr = SqlStringToString(tableType, tableTypeLen);
 
-        LOG_MSG("catalog: %s\n", catalog.c_str());
-        LOG_MSG("schema: %s\n", schema.c_str());
-        LOG_MSG("table: %s\n", table.c_str());
-        LOG_MSG("tableType: %s\n", tableTypeStr.c_str());
+        LOG_MSG("catalog: " << catalog);
+        LOG_MSG("schema: " << schema);
+        LOG_MSG("table: " << table);
+        LOG_MSG("tableType: " << tableTypeStr);
 
         statement->ExecuteGetTablesMetaQuery(catalog, schema, table, tableTypeStr);
 
@@ -553,7 +560,7 @@ namespace ignite
         using odbc::Statement;
         using utility::SqlStringToString;
 
-        LOG_MSG("SQLColumns called\n");
+        LOG_MSG("SQLColumns called");
 
         Statement *statement = reinterpret_cast<Statement*>(stmt);
 
@@ -565,10 +572,10 @@ namespace ignite
         std::string table = SqlStringToString(tableName, tableNameLen);
         std::string column = SqlStringToString(columnName, columnNameLen);
 
-        LOG_MSG("catalog: %s\n", catalog.c_str());
-        LOG_MSG("schema: %s\n", schema.c_str());
-        LOG_MSG("table: %s\n", table.c_str());
-        LOG_MSG("column: %s\n", column.c_str());
+        LOG_MSG("catalog: " << catalog);
+        LOG_MSG("schema: " << schema);
+        LOG_MSG("table: " << table);
+        LOG_MSG("column: " << column);
 
         statement->ExecuteGetColumnsMetaQuery(schema, table, column);
 
@@ -579,7 +586,7 @@ namespace ignite
     {
         using odbc::Statement;
 
-        LOG_MSG("SQLMoreResults called\n");
+        LOG_MSG("SQLMoreResults called");
 
         Statement *statement = reinterpret_cast<Statement*>(stmt);
 
@@ -604,7 +611,7 @@ namespace ignite
     {
         using odbc::Statement;
 
-        LOG_MSG("SQLBindParameter called: %d, %d, %d\n", paramIdx, bufferType, paramSqlType);
+        LOG_MSG("SQLBindParameter called: " << paramIdx << ", " << bufferType << ", " << paramSqlType);
 
         Statement *statement = reinterpret_cast<Statement*>(stmt);
 
@@ -625,7 +632,7 @@ namespace ignite
     {
         using namespace utility;
 
-        LOG_MSG("SQLNativeSql called\n");
+        LOG_MSG("SQLNativeSql called");
 
         std::string in = SqlStringToString(inQuery, inQueryLen);
 
@@ -650,7 +657,7 @@ namespace ignite
         using odbc::meta::ColumnMetaVector;
         using odbc::meta::ColumnMeta;
 
-        LOG_MSG("SQLColAttribute called: %d (%s)\n", fieldId, ColumnMeta::AttrIdToString(fieldId));
+        LOG_MSG("SQLColAttribute called: " << fieldId << " (" << ColumnMeta::AttrIdToString(fieldId) << ")");
 
         Statement *statement = reinterpret_cast<Statement*>(stmt);
 
@@ -689,7 +696,7 @@ namespace ignite
         using odbc::Statement;
         using odbc::SqlLen;
 
-        LOG_MSG("SQLDescribeCol called\n");
+        LOG_MSG("SQLDescribeCol called");
 
         Statement *statement = reinterpret_cast<Statement*>(stmt);
 
@@ -709,13 +716,13 @@ namespace ignite
         statement->GetColumnAttribute(columnNum, SQL_DESC_SCALE, 0, 0, 0, &decimalDigitsRes);
         statement->GetColumnAttribute(columnNum, SQL_DESC_NULLABLE, 0, 0, 0, &nullableRes);
 
-        LOG_MSG("columnNum: %lld\n", columnNum);
-        LOG_MSG("dataTypeRes: %lld\n", dataTypeRes);
-        LOG_MSG("columnSizeRes: %lld\n", columnSizeRes);
-        LOG_MSG("decimalDigitsRes: %lld\n", decimalDigitsRes);
-        LOG_MSG("nullableRes: %lld\n", nullableRes);
-        LOG_MSG("columnNameBuf: %s\n", columnNameBuf ? reinterpret_cast<const char*>(columnNameBuf) : "<null>");
-        LOG_MSG("columnNameLen: %d\n", columnNameLen ? *columnNameLen : -1);
+        LOG_MSG("columnNum: " << columnNum);
+        LOG_MSG("dataTypeRes: " << dataTypeRes);
+        LOG_MSG("columnSizeRes: " << columnSizeRes);
+        LOG_MSG("decimalDigitsRes: " << decimalDigitsRes);
+        LOG_MSG("nullableRes: " << nullableRes);
+        LOG_MSG("columnNameBuf: " << (columnNameBuf ? reinterpret_cast<const char*>(columnNameBuf) : "<null>"));
+        LOG_MSG("columnNameLen: " << (columnNameLen ? *columnNameLen : -1));
 
         if (dataType)
             *dataType = static_cast<SQLSMALLINT>(dataTypeRes);
@@ -737,7 +744,7 @@ namespace ignite
     {
         using odbc::Statement;
 
-        LOG_MSG("SQLRowCount called\n");
+        LOG_MSG("SQLRowCount called");
 
         Statement *statement = reinterpret_cast<Statement*>(stmt);
 
@@ -769,7 +776,7 @@ namespace ignite
         using odbc::Statement;
         using utility::SqlStringToString;
 
-        LOG_MSG("SQLForeignKeys called\n");
+        LOG_MSG("SQLForeignKeys called");
 
         Statement *statement = reinterpret_cast<Statement*>(stmt);
 
@@ -783,12 +790,12 @@ namespace ignite
         std::string foreignSchema = SqlStringToString(foreignSchemaName, foreignSchemaNameLen);
         std::string foreignTable = SqlStringToString(foreignTableName, foreignTableNameLen);
 
-        LOG_MSG("primaryCatalog: %s\n", primaryCatalog.c_str());
-        LOG_MSG("primarySchema: %s\n", primarySchema.c_str());
-        LOG_MSG("primaryTable: %s\n", primaryTable.c_str());
-        LOG_MSG("foreignCatalog: %s\n", foreignCatalog.c_str());
-        LOG_MSG("foreignSchema: %s\n", foreignSchema.c_str());
-        LOG_MSG("foreignTable: %s\n", foreignTable.c_str());
+        LOG_MSG("primaryCatalog: " << primaryCatalog);
+        LOG_MSG("primarySchema: " << primarySchema);
+        LOG_MSG("primaryTable: " << primaryTable);
+        LOG_MSG("foreignCatalog: " << foreignCatalog);
+        LOG_MSG("foreignSchema: " << foreignSchema);
+        LOG_MSG("foreignTable: " << foreignTable);
 
         statement->ExecuteGetForeignKeysQuery(primaryCatalog, primarySchema,
             primaryTable, foreignCatalog, foreignSchema, foreignTable);
@@ -809,7 +816,7 @@ namespace ignite
 #ifdef ODBC_DEBUG
         using odbc::type_traits::StatementAttrIdToString;
 
-        LOG_MSG("Attr: %s (%d)\n", StatementAttrIdToString(attr), attr);
+        LOG_MSG("Attr: " << StatementAttrIdToString(attr) << " (" << attr << ")");
 #endif //ODBC_DEBUG
 
         Statement *statement = reinterpret_cast<Statement*>(stmt);
@@ -834,7 +841,7 @@ namespace ignite
 #ifdef ODBC_DEBUG
         using odbc::type_traits::StatementAttrIdToString;
 
-        LOG_MSG("Attr: %s (%d)\n", StatementAttrIdToString(attr), attr);
+        LOG_MSG("Attr: " << StatementAttrIdToString(attr) << " (" << attr << ")");
 #endif //ODBC_DEBUG
 
         Statement *statement = reinterpret_cast<Statement*>(stmt);
@@ -858,7 +865,7 @@ namespace ignite
         using odbc::Statement;
         using utility::SqlStringToString;
 
-        LOG_MSG("SQLPrimaryKeys called\n");
+        LOG_MSG("SQLPrimaryKeys called");
 
         Statement *statement = reinterpret_cast<Statement*>(stmt);
 
@@ -869,9 +876,9 @@ namespace ignite
         std::string schema = SqlStringToString(schemaName, schemaNameLen);
         std::string table = SqlStringToString(tableName, tableNameLen);
 
-        LOG_MSG("catalog: %s\n", catalog.c_str());
-        LOG_MSG("schema: %s\n", schema.c_str());
-        LOG_MSG("table: %s\n", table.c_str());
+        LOG_MSG("catalog: " << catalog);
+        LOG_MSG("schema: " << schema);
+        LOG_MSG("table: " << table);
 
         statement->ExecuteGetPrimaryKeysQuery(catalog, schema, table);
 
@@ -882,7 +889,7 @@ namespace ignite
     {
         using odbc::Statement;
 
-        LOG_MSG("SQLNumParams called\n");
+        LOG_MSG("SQLNumParams called");
 
         Statement *statement = reinterpret_cast<Statement*>(stmt);
 
@@ -909,7 +916,7 @@ namespace ignite
 
         using odbc::app::ApplicationDataBuffer;
 
-        LOG_MSG("SQLGetDiagField called: %d\n", recNum);
+        LOG_MSG("SQLGetDiagField called: " << recNum);
 
         SqlLen outResLen;
         ApplicationDataBuffer outBuffer(IGNITE_ODBC_C_TYPE_DEFAULT, buffer, bufferLen, &outResLen);
@@ -960,7 +967,7 @@ namespace ignite
 
         using odbc::app::ApplicationDataBuffer;
 
-        LOG_MSG("SQLGetDiagRec called\n");
+        LOG_MSG("SQLGetDiagRec called");
 
         const DiagnosticRecordStorage* records = 0;
 
@@ -1007,7 +1014,7 @@ namespace ignite
     {
         using odbc::Statement;
 
-        LOG_MSG("SQLGetTypeInfo called\n");
+        LOG_MSG("SQLGetTypeInfo called");
 
         Statement *statement = reinterpret_cast<Statement*>(stmt);
 
@@ -1023,7 +1030,7 @@ namespace ignite
     {
         using namespace odbc;
 
-        LOG_MSG("SQLEndTran called\n");
+        LOG_MSG("SQLEndTran called");
 
         SQLRETURN result;
 
@@ -1086,7 +1093,7 @@ namespace ignite
         using odbc::Statement;
         using odbc::app::ApplicationDataBuffer;
 
-        LOG_MSG("SQLGetData called\n");
+        LOG_MSG("SQLGetData called");
 
         Statement *statement = reinterpret_cast<Statement*>(stmt);
 
@@ -1109,7 +1116,7 @@ namespace ignite
     {
         using odbc::Environment;
 
-        LOG_MSG("SQLSetEnvAttr called\n");
+        LOG_MSG("SQLSetEnvAttr called");
 
         Environment *environment = reinterpret_cast<Environment*>(env);
 
@@ -1132,7 +1139,7 @@ namespace ignite
 
         using odbc::app::ApplicationDataBuffer;
 
-        LOG_MSG("SQLGetEnvAttr called\n");
+        LOG_MSG("SQLGetEnvAttr called");
 
         Environment *environment = reinterpret_cast<Environment*>(env);
 
@@ -1166,7 +1173,7 @@ namespace ignite
 
         using utility::SqlStringToString;
 
-        LOG_MSG("SQLSpecialColumns called\n");
+        LOG_MSG("SQLSpecialColumns called");
 
         Statement *statement = reinterpret_cast<Statement*>(stmt);
 
@@ -1177,9 +1184,9 @@ namespace ignite
         std::string schema = SqlStringToString(schemaName, schemaNameLen);
         std::string table = SqlStringToString(tableName, tableNameLen);
 
-        LOG_MSG("catalog: %s\n", catalog.c_str());
-        LOG_MSG("schema: %s\n", schema.c_str());
-        LOG_MSG("table: %s\n", table.c_str());
+        LOG_MSG("catalog: " << catalog);
+        LOG_MSG("schema: " << schema);
+        LOG_MSG("table: " << table);
 
         statement->ExecuteSpecialColumnsQuery(idType, catalog, schema, table, scope, nullable);
 
@@ -1190,7 +1197,7 @@ namespace ignite
     {
         using namespace ignite::odbc;
 
-        LOG_MSG("SQLParamData called\n");
+        LOG_MSG("SQLParamData called");
 
         Statement *statement = reinterpret_cast<Statement*>(stmt);
 
@@ -1206,7 +1213,7 @@ namespace ignite
     {
         using namespace ignite::odbc;
 
-        LOG_MSG("SQLPutData called\n");
+        LOG_MSG("SQLPutData called");
 
         Statement *statement = reinterpret_cast<Statement*>(stmt);
 
@@ -1227,7 +1234,7 @@ namespace ignite
     {
         using namespace ignite::odbc;
 
-        LOG_MSG("SQLDescribeParam called\n");
+        LOG_MSG("SQLDescribeParam called");
 
         Statement *statement = reinterpret_cast<Statement*>(stmt);
 
@@ -1255,7 +1262,7 @@ namespace ignite
 
         using ignite::odbc::app::ApplicationDataBuffer;
 
-        LOG_MSG("SQLError called\n");
+        LOG_MSG("SQLError called");
 
         SQLHANDLE handle = 0;
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/825fe9cd/modules/platforms/cpp/odbc/src/query/column_metadata_query.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/src/query/column_metadata_query.cpp b/modules/platforms/cpp/odbc/src/query/column_metadata_query.cpp
index 1cd2a9f..9aa5f7d 100644
--- a/modules/platforms/cpp/odbc/src/query/column_metadata_query.cpp
+++ b/modules/platforms/cpp/odbc/src/query/column_metadata_query.cpp
@@ -20,6 +20,7 @@
 #include "ignite/odbc/type_traits.h"
 #include "ignite/odbc/connection.h"
 #include "ignite/odbc/message.h"
+#include "ignite/odbc/log.h"
 #include "ignite/odbc/query/column_metadata_query.h"
 
 namespace
@@ -292,8 +293,7 @@ namespace ignite
 
                 if (rsp.GetStatus() != RESPONSE_STATUS_SUCCESS)
                 {
-                    LOG_MSG("Error: %s\n", rsp.GetError().c_str());
-
+                    LOG_MSG("Error: " << rsp.GetError());
                     diag.AddStatusRecord(SQL_STATE_HY000_GENERAL_ERROR, rsp.GetError());
 
                     return SQL_RESULT_ERROR;
@@ -303,11 +303,10 @@ namespace ignite
 
                 for (size_t i = 0; i < meta.size(); ++i)
                 {
-                    LOG_MSG("[%d] SchemaName:     %s\n", i, meta[i].GetSchemaName().c_str());
-                    LOG_MSG("[%d] TableName:      %s\n", i, meta[i].GetTableName().c_str());
-                    LOG_MSG("[%d] ColumnName:     %s\n", i, meta[i].GetColumnName().c_str());
-                    LOG_MSG("[%d] ColumnType:     %d\n", i, meta[i].GetDataType());
-                    LOG_MSG("\n");
+                    LOG_MSG("\n[" << i << "] SchemaName:     " << meta[i].GetSchemaName()
+                         << "\n[" << i << "] TableName:      " << meta[i].GetTableName()
+                         << "\n[" << i << "] ColumnName:     " << meta[i].GetColumnName()
+                         << "\n[" << i << "] ColumnType:     " << meta[i].GetDataType());
                 }
 
                 return SQL_RESULT_SUCCESS;

http://git-wip-us.apache.org/repos/asf/ignite/blob/825fe9cd/modules/platforms/cpp/odbc/src/query/data_query.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/src/query/data_query.cpp b/modules/platforms/cpp/odbc/src/query/data_query.cpp
index 5b1b758..c9762ad 100644
--- a/modules/platforms/cpp/odbc/src/query/data_query.cpp
+++ b/modules/platforms/cpp/odbc/src/query/data_query.cpp
@@ -17,6 +17,7 @@
 
 #include "ignite/odbc/connection.h"
 #include "ignite/odbc/message.h"
+#include "ignite/odbc/log.h"
 #include "ignite/odbc/query/data_query.h"
 
 namespace ignite
@@ -40,7 +41,7 @@ namespace ignite
             {
                 Close();
             }
-            
+
             SqlResult DataQuery::Execute()
             {
                 if (cursor.get())
@@ -186,7 +187,7 @@ namespace ignite
 
                 if (rsp.GetStatus() != RESPONSE_STATUS_SUCCESS)
                 {
-                    LOG_MSG("Error: %s\n", rsp.GetError().c_str());
+                    LOG_MSG("Error: " << rsp.GetError());
 
                     diag.AddStatusRecord(SQL_STATE_HY000_GENERAL_ERROR, rsp.GetError());
 
@@ -197,15 +198,13 @@ namespace ignite
 
                 resultMeta.assign(rsp.GetMeta().begin(), rsp.GetMeta().end());
 
-                LOG_MSG("Query id: %lld\n", cursor->GetQueryId());
-
+                LOG_MSG("Query id: " << cursor->GetQueryId());
                 for (size_t i = 0; i < rsp.GetMeta().size(); ++i)
                 {
-                    LOG_MSG("[%d] SchemaName:     %s\n", i, rsp.GetMeta()[i].GetSchemaName().c_str());
-                    LOG_MSG("[%d] TypeName:       %s\n", i, rsp.GetMeta()[i].GetTableName().c_str());
-                    LOG_MSG("[%d] ColumnName:     %s\n", i, rsp.GetMeta()[i].GetColumnName().c_str());
-                    LOG_MSG("[%d] ColumnType:     %d\n", i, rsp.GetMeta()[i].GetDataType());
-                    LOG_MSG("\n");
+                    LOG_MSG("\n[" << i << "] SchemaName:     " << rsp.GetMeta()[i].GetSchemaName()
+                        <<  "\n[" << i << "] TypeName:       " << rsp.GetMeta()[i].GetTableName()
+                        <<  "\n[" << i << "] ColumnName:     " << rsp.GetMeta()[i].GetColumnName()
+                        <<  "\n[" << i << "] ColumnType:     " << rsp.GetMeta()[i].GetDataType());
                 }
 
                 return SQL_RESULT_SUCCESS;
@@ -227,11 +226,11 @@ namespace ignite
                     return SQL_RESULT_ERROR;
                 }
 
-                LOG_MSG("Query id: %lld\n", rsp.GetQueryId());
+                LOG_MSG("Query id: " << rsp.GetQueryId());
 
                 if (rsp.GetStatus() != RESPONSE_STATUS_SUCCESS)
                 {
-                    LOG_MSG("Error: %s\n", rsp.GetError().c_str());
+                    LOG_MSG("Error: " << rsp.GetError());
 
                     diag.AddStatusRecord(SQL_STATE_HY000_GENERAL_ERROR, rsp.GetError());
 
@@ -261,7 +260,7 @@ namespace ignite
 
                 if (rsp.GetStatus() != RESPONSE_STATUS_SUCCESS)
                 {
-                    LOG_MSG("Error: %s\n", rsp.GetError().c_str());
+                    LOG_MSG("Error: " << rsp.GetError());
 
                     diag.AddStatusRecord(SQL_STATE_HY000_GENERAL_ERROR, rsp.GetError());
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/825fe9cd/modules/platforms/cpp/odbc/src/query/table_metadata_query.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/src/query/table_metadata_query.cpp b/modules/platforms/cpp/odbc/src/query/table_metadata_query.cpp
index 3cddd1b..4fd5f7b 100644
--- a/modules/platforms/cpp/odbc/src/query/table_metadata_query.cpp
+++ b/modules/platforms/cpp/odbc/src/query/table_metadata_query.cpp
@@ -20,6 +20,7 @@
 #include "ignite/odbc/type_traits.h"
 #include "ignite/odbc/connection.h"
 #include "ignite/odbc/message.h"
+#include "ignite/odbc/log.h"
 #include "ignite/odbc/query/table_metadata_query.h"
 
 namespace
@@ -218,7 +219,7 @@ namespace ignite
 
                 if (rsp.GetStatus() != RESPONSE_STATUS_SUCCESS)
                 {
-                    LOG_MSG("Error: %s\n", rsp.GetError().c_str());
+                    LOG_MSG("Error: " << rsp.GetError());
 
                     diag.AddStatusRecord(SQL_STATE_HY000_GENERAL_ERROR, rsp.GetError());
 
@@ -229,11 +230,10 @@ namespace ignite
 
                 for (size_t i = 0; i < meta.size(); ++i)
                 {
-                    LOG_MSG("[%d] CatalogName: %s\n", i, meta[i].GetCatalogName().c_str());
-                    LOG_MSG("[%d] SchemaName:  %s\n", i, meta[i].GetSchemaName().c_str());
-                    LOG_MSG("[%d] TableName:   %s\n", i, meta[i].GetTableName().c_str());
-                    LOG_MSG("[%d] TableType:   %s\n", i, meta[i].GetTableType().c_str());
-                    LOG_MSG("\n");
+                    LOG_MSG("\n[" << i << "] CatalogName: " << meta[i].GetCatalogName()
+                         << "\n[" << i << "] SchemaName:  " << meta[i].GetSchemaName()
+                         << "\n[" << i << "] TableName:   " << meta[i].GetTableName()
+                         << "\n[" << i << "] TableType:   " << meta[i].GetTableType());
                 }
 
                 return SQL_RESULT_SUCCESS;

http://git-wip-us.apache.org/repos/asf/ignite/blob/825fe9cd/modules/platforms/cpp/odbc/src/statement.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/src/statement.cpp b/modules/platforms/cpp/odbc/src/statement.cpp
index 09ad81c..2395d66 100644
--- a/modules/platforms/cpp/odbc/src/statement.cpp
+++ b/modules/platforms/cpp/odbc/src/statement.cpp
@@ -27,6 +27,7 @@
 #include "ignite/odbc/utility.h"
 #include "ignite/odbc/message.h"
 #include "ignite/odbc/statement.h"
+#include "ignite/odbc/log.h"
 
 namespace ignite
 {
@@ -232,7 +233,7 @@ namespace ignite
                 {
                     SQLULEN val = reinterpret_cast<SQLULEN>(value);
 
-                    LOG_MSG("SQL_ATTR_ROW_ARRAY_SIZE: %d\n", val);
+                    LOG_MSG("SQL_ATTR_ROW_ARRAY_SIZE: " << val);
 
                     if (val != 1)
                     {
@@ -986,7 +987,7 @@ namespace ignite
             if (paramNum > 0 && static_cast<size_t>(paramNum) <= paramTypes.size())
                 type = paramTypes[paramNum - 1];
 
-            LOG_MSG("Type: %d\n", type);
+            LOG_MSG("Type: " << type);
 
             if (!type)
             {
@@ -1044,7 +1045,7 @@ namespace ignite
 
             if (rsp.GetStatus() != RESPONSE_STATUS_SUCCESS)
             {
-                LOG_MSG("Error: %s\n", rsp.GetError().c_str());
+                LOG_MSG("Error: " << rsp.GetError());
 
                 AddStatusRecord(SQL_STATE_HY000_GENERAL_ERROR, rsp.GetError());
 
@@ -1054,7 +1055,9 @@ namespace ignite
             paramTypes = rsp.GetTypeIds();
 
             for (size_t i = 0; i < paramTypes.size(); ++i)
-                LOG_MSG("[%zu] Parameter type: %u\n", i, paramTypes[i]);
+            {
+                LOG_MSG("[" << i << "] Parameter type: " << paramTypes[i]);
+            }
 
             return SQL_RESULT_SUCCESS;
         }

http://git-wip-us.apache.org/repos/asf/ignite/blob/825fe9cd/modules/platforms/cpp/odbc/src/utility.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/src/utility.cpp b/modules/platforms/cpp/odbc/src/utility.cpp
index c15c23c..63454dc 100644
--- a/modules/platforms/cpp/odbc/src/utility.cpp
+++ b/modules/platforms/cpp/odbc/src/utility.cpp
@@ -22,20 +22,6 @@
 #include "ignite/odbc/utility.h"
 #include "ignite/odbc/system/odbc_constants.h"
 
-#ifdef ODBC_DEBUG
-
-FILE* log_file = NULL;
-
-void logInit(const char* path)
-{
-    if (!log_file)
-    {
-        log_file = fopen(path, "w");
-    }
-}
-
-#endif //ODBC_DEBUG
-
 namespace ignite
 {
     namespace utility
@@ -155,11 +141,11 @@ namespace ignite
                 res.clear();
         }
 
-        std::string HexDump(const char* data, size_t count)
+        std::string HexDump(const void* data, size_t count)
         {
             std::stringstream  dump;
             size_t cnt = 0;
-            for(const char* p = data, *e = data + count; p != e; ++p)
+            for(const uint8_t* p = (const uint8_t*)data, *e = (const uint8_t*)data + count; p != e; ++p)
             {
                 if (cnt++ % 16 == 0)
                 {


[3/9] ignite git commit: IGNITE-4532 .NET: Fix build warnings

Posted by yz...@apache.org.
IGNITE-4532 .NET: Fix build warnings


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/87fbb275
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/87fbb275
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/87fbb275

Branch: refs/heads/ignite-comm-balance-master
Commit: 87fbb275eb9d11084485e6b4314b5bf7f8d42a1a
Parents: 825fe9c
Author: Pavel Tupitsyn <pt...@apache.org>
Authored: Tue Jan 10 16:02:26 2017 +0300
Committer: Pavel Tupitsyn <pt...@apache.org>
Committed: Tue Jan 10 16:02:26 2017 +0300

----------------------------------------------------------------------
 .../platforms/cpp/common/project/vs/common.vcxproj  |  1 +
 modules/platforms/cpp/jni/project/vs/jni.vcxproj    |  1 +
 .../Apache.Ignite.AspNet.Tests.csproj               |  7 ++++++-
 .../Apache.Ignite.AspNet.csproj                     |  5 +++++
 .../Apache.Ignite.Benchmarks.csproj                 |  5 +++++
 .../Apache.Ignite.Core.Tests.TestDll.csproj         |  5 +++++
 .../Apache.Ignite.Core.Tests.csproj                 |  5 +++++
 .../dotnet/Apache.Ignite.Core.Tests/TestUtils.cs    |  1 -
 .../Apache.Ignite.Core/Apache.Ignite.Core.csproj    | 16 ++++++++--------
 .../Impl/Unmanaged/UnmanagedUtils.cs                |  4 ++--
 .../Apache.Ignite.EntityFramework.Tests.csproj      |  5 +++++
 .../Apache.Ignite.EntityFramework.csproj            |  9 +++++++--
 .../Impl/ArrayDbDataReader.cs                       |  5 +++++
 .../Impl/DataReaderResult.cs                        |  2 ++
 .../Impl/DbCommandInfo.cs                           | 11 +++++++++++
 .../Impl/DbCommandProxy.cs                          |  1 +
 .../Apache.Ignite.Linq/Apache.Ignite.Linq.csproj    |  5 +++++
 .../Apache.Ignite.Log4Net.csproj                    |  5 +++++
 .../Apache.Ignite.Log4Net/IgniteLog4NetLogger.cs    | 16 ++++++++--------
 .../Apache.Ignite.NLog/Apache.Ignite.NLog.csproj    |  5 +++++
 modules/platforms/dotnet/Apache.Ignite.sln          |  3 +++
 .../dotnet/Apache.Ignite/Apache.Ignite.csproj       |  5 +++++
 .../Apache.Ignite.Examples.csproj                   |  3 +++
 .../Apache.Ignite.ExamplesDll.csproj                |  4 ++++
 .../Services/MapService.cs                          |  2 --
 25 files changed, 107 insertions(+), 24 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/87fbb275/modules/platforms/cpp/common/project/vs/common.vcxproj
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/common/project/vs/common.vcxproj b/modules/platforms/cpp/common/project/vs/common.vcxproj
index 99fd551..b4431f8 100644
--- a/modules/platforms/cpp/common/project/vs/common.vcxproj
+++ b/modules/platforms/cpp/common/project/vs/common.vcxproj
@@ -97,6 +97,7 @@
       <Optimization>Disabled</Optimization>
       <PreprocessorDefinitions>_SCL_SECURE_NO_WARNINGS;WIN32;_DEBUG;_WINDOWS;_USRDLL;IGNITEJVM_EXPORTS;_CRT_SECURE_NO_WARNINGS;IGNITE_IMPL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <AdditionalIncludeDirectories>$(ProjectDir)\..\..\include;$(ProjectDir)\..\..\os\win\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
     </ClCompile>
     <Link>
       <SubSystem>Windows</SubSystem>

http://git-wip-us.apache.org/repos/asf/ignite/blob/87fbb275/modules/platforms/cpp/jni/project/vs/jni.vcxproj
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/jni/project/vs/jni.vcxproj b/modules/platforms/cpp/jni/project/vs/jni.vcxproj
index f080a68..cb03197 100644
--- a/modules/platforms/cpp/jni/project/vs/jni.vcxproj
+++ b/modules/platforms/cpp/jni/project/vs/jni.vcxproj
@@ -97,6 +97,7 @@
       <Optimization>Disabled</Optimization>
       <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;IGNITEJVM_EXPORTS;_CRT_SECURE_NO_WARNINGS;IGNITE_IMPL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <AdditionalIncludeDirectories>$(JAVA_HOME)\include;$(JAVA_HOME)\include\win32;$(ProjectDir)\..\..\..\common\include;$(ProjectDir)\..\..\..\common\os\win\include;$(ProjectDir)\..\..\include;$(ProjectDir)\..\..\os\win\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
     </ClCompile>
     <Link>
       <SubSystem>Windows</SubSystem>

http://git-wip-us.apache.org/repos/asf/ignite/blob/87fbb275/modules/platforms/dotnet/Apache.Ignite.AspNet.Tests/Apache.Ignite.AspNet.Tests.csproj
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.AspNet.Tests/Apache.Ignite.AspNet.Tests.csproj b/modules/platforms/dotnet/Apache.Ignite.AspNet.Tests/Apache.Ignite.AspNet.Tests.csproj
index aed74db..628942d 100644
--- a/modules/platforms/dotnet/Apache.Ignite.AspNet.Tests/Apache.Ignite.AspNet.Tests.csproj
+++ b/modules/platforms/dotnet/Apache.Ignite.AspNet.Tests/Apache.Ignite.AspNet.Tests.csproj
@@ -21,7 +21,8 @@
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
     <RunCodeAnalysis>true</RunCodeAnalysis>
-    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
+    <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
     <DebugType>pdbonly</DebugType>
@@ -30,6 +31,7 @@
     <DefineConstants>TRACE</DefineConstants>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
+    <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
   </PropertyGroup>
   <PropertyGroup>
     <SignAssembly>true</SignAssembly>
@@ -37,6 +39,9 @@
   <PropertyGroup>
     <AssemblyOriginatorKeyFile>Apache.Ignite.AspNet.Tests.snk</AssemblyOriginatorKeyFile>
   </PropertyGroup>
+  <PropertyGroup>
+    <ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>None</ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
+  </PropertyGroup>
   <ItemGroup>
     <Reference Include="nunit.framework">
       <HintPath>..\packages\NUnit.Runners.2.6.3\tools\nunit.framework.dll</HintPath>

http://git-wip-us.apache.org/repos/asf/ignite/blob/87fbb275/modules/platforms/dotnet/Apache.Ignite.AspNet/Apache.Ignite.AspNet.csproj
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.AspNet/Apache.Ignite.AspNet.csproj b/modules/platforms/dotnet/Apache.Ignite.AspNet/Apache.Ignite.AspNet.csproj
index 2e501c1..4508776 100644
--- a/modules/platforms/dotnet/Apache.Ignite.AspNet/Apache.Ignite.AspNet.csproj
+++ b/modules/platforms/dotnet/Apache.Ignite.AspNet/Apache.Ignite.AspNet.csproj
@@ -28,6 +28,7 @@
     <RunCodeAnalysis>true</RunCodeAnalysis>
     <ErrorReport>prompt</ErrorReport>
     <CodeAnalysisRuleSet>Apache.Ignite.AspNet.ruleset</CodeAnalysisRuleSet>
+    <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
     <OutputPath>bin\Release\</OutputPath>
@@ -37,6 +38,10 @@
     <ErrorReport>prompt</ErrorReport>
     <CodeAnalysisRuleSet>Apache.Ignite.AspNet.ruleset</CodeAnalysisRuleSet>
     <DocumentationFile>bin\Release\Apache.Ignite.AspNet.XML</DocumentationFile>
+    <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
+  </PropertyGroup>
+  <PropertyGroup>
+    <ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>None</ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
   </PropertyGroup>
   <ItemGroup>
     <Reference Include="System" />

http://git-wip-us.apache.org/repos/asf/ignite/blob/87fbb275/modules/platforms/dotnet/Apache.Ignite.Benchmarks/Apache.Ignite.Benchmarks.csproj
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Benchmarks/Apache.Ignite.Benchmarks.csproj b/modules/platforms/dotnet/Apache.Ignite.Benchmarks/Apache.Ignite.Benchmarks.csproj
index 811047c..65dfc1e 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Benchmarks/Apache.Ignite.Benchmarks.csproj
+++ b/modules/platforms/dotnet/Apache.Ignite.Benchmarks/Apache.Ignite.Benchmarks.csproj
@@ -27,12 +27,17 @@
     <DefineConstants>DEBUG</DefineConstants>
     <PlatformTarget>AnyCPU</PlatformTarget>
     <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
+    <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
     <OutputPath>bin\Release\</OutputPath>
     <Optimize>true</Optimize>
     <PlatformTarget>AnyCPU</PlatformTarget>
     <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
+    <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
+  </PropertyGroup>
+  <PropertyGroup>
+    <ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>None</ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
   </PropertyGroup>
   <ItemGroup>
     <Reference Include="System" />

http://git-wip-us.apache.org/repos/asf/ignite/blob/87fbb275/modules/platforms/dotnet/Apache.Ignite.Core.Tests.TestDll/Apache.Ignite.Core.Tests.TestDll.csproj
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests.TestDll/Apache.Ignite.Core.Tests.TestDll.csproj b/modules/platforms/dotnet/Apache.Ignite.Core.Tests.TestDll/Apache.Ignite.Core.Tests.TestDll.csproj
index b33023a..db7a4d1 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests.TestDll/Apache.Ignite.Core.Tests.TestDll.csproj
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests.TestDll/Apache.Ignite.Core.Tests.TestDll.csproj
@@ -23,12 +23,17 @@
     <OutputPath>bin\Debug\</OutputPath>
     <PlatformTarget>AnyCPU</PlatformTarget>
     <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
+    <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
     <OutputPath>bin\Release\</OutputPath>
     <Optimize>true</Optimize>
     <PlatformTarget>AnyCPU</PlatformTarget>
     <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
+    <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
+  </PropertyGroup>
+  <PropertyGroup>
+    <ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>None</ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
   </PropertyGroup>
   <ItemGroup>
     <Reference Include="System" />

http://git-wip-us.apache.org/repos/asf/ignite/blob/87fbb275/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Apache.Ignite.Core.Tests.csproj
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Apache.Ignite.Core.Tests.csproj b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Apache.Ignite.Core.Tests.csproj
index 55adfe4..78a08d2 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Apache.Ignite.Core.Tests.csproj
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Apache.Ignite.Core.Tests.csproj
@@ -28,6 +28,7 @@
     <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
     <PlatformTarget>AnyCPU</PlatformTarget>
     <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
+    <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
     <OutputPath>bin\Release\</OutputPath>
@@ -35,6 +36,10 @@
     <Optimize>true</Optimize>
     <PlatformTarget>AnyCPU</PlatformTarget>
     <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
+    <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
+  </PropertyGroup>
+  <PropertyGroup>
+    <ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>None</ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
   </PropertyGroup>
   <ItemGroup>
     <Reference Include="log4net, Version=1.2.15.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">

http://git-wip-us.apache.org/repos/asf/ignite/blob/87fbb275/modules/platforms/dotnet/Apache.Ignite.Core.Tests/TestUtils.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/TestUtils.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/TestUtils.cs
index ad27398..8360bf1 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/TestUtils.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/TestUtils.cs
@@ -15,7 +15,6 @@
  * limitations under the License.
  */
 
-#pragma warning disable S2360 // Optional parameters should not be used
 namespace Apache.Ignite.Core.Tests
 {
     using System;

http://git-wip-us.apache.org/repos/asf/ignite/blob/87fbb275/modules/platforms/dotnet/Apache.Ignite.Core/Apache.Ignite.Core.csproj
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Apache.Ignite.Core.csproj b/modules/platforms/dotnet/Apache.Ignite.Core/Apache.Ignite.Core.csproj
index b2db0a7..a80dfc0 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Apache.Ignite.Core.csproj
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Apache.Ignite.Core.csproj
@@ -21,6 +21,7 @@
     <DocumentationFile>bin\x64\Debug\Apache.Ignite.Core.XML</DocumentationFile>
     <RunCodeAnalysis>false</RunCodeAnalysis>
     <CodeAnalysisRuleSet>Apache.Ignite.Core.ruleset</CodeAnalysisRuleSet>
+    <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
     <PlatformTarget>x64</PlatformTarget>
@@ -30,6 +31,7 @@
     <Optimize>true</Optimize>
     <DocumentationFile>bin\x64\Release\Apache.Ignite.Core.XML</DocumentationFile>
     <CodeAnalysisRuleSet>Apache.Ignite.Core.ruleset</CodeAnalysisRuleSet>
+    <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
     <PlatformTarget>x86</PlatformTarget>
@@ -39,6 +41,7 @@
     <CodeAnalysisRuleSet>Apache.Ignite.Core.ruleset</CodeAnalysisRuleSet>
     <DocumentationFile>bin\x86\Debug\Apache.Ignite.Core.XML</DocumentationFile>
     <CodeAnalysisRuleSet>Apache.Ignite.Core.ruleset</CodeAnalysisRuleSet>
+    <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
     <PlatformTarget>x86</PlatformTarget>
@@ -48,6 +51,7 @@
     <Optimize>true</Optimize>
     <DocumentationFile>bin\x86\Release\Apache.Ignite.Core.XML</DocumentationFile>
     <CodeAnalysisRuleSet>Apache.Ignite.Core.ruleset</CodeAnalysisRuleSet>
+    <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
   </PropertyGroup>
   <PropertyGroup>
     <SignAssembly>true</SignAssembly>
@@ -67,6 +71,7 @@
     <PlatformTarget>AnyCPU</PlatformTarget>
     <RunCodeAnalysis>true</RunCodeAnalysis>
     <CodeAnalysisRuleSet>Apache.Ignite.Core.ruleset</CodeAnalysisRuleSet>
+    <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
     <OutputPath>bin\Release\</OutputPath>
@@ -76,6 +81,7 @@
     <PlatformTarget>AnyCPU</PlatformTarget>
     <CodeAnalysisRuleSet>Apache.Ignite.Core.ruleset</CodeAnalysisRuleSet>
     <DebugType>none</DebugType>
+    <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
   </PropertyGroup>
   <ItemGroup>
     <Reference Include="System" />
@@ -514,10 +520,10 @@
   </ItemGroup>
   <ItemGroup Condition="'$(Platform)' == 'AnyCPU'">
     <EmbeddedResource Include="$(ProjectDir)..\..\cpp\jni\project\vs\x64\$(Configuration)\ignite.jni.dll">
-      <Link>resources\$(Configuration)\x64\ignite.jni.dll</Link>
+      <Link>resources\x64\ignite.jni.dll</Link>
     </EmbeddedResource>
     <EmbeddedResource Include="$(ProjectDir)..\..\cpp\jni\project\vs\Win32\$(Configuration)\ignite.jni.dll" Condition="'$(Configuration)' == 'Release' Or Exists('$(ProjectDir)..\..\cpp\jni\project\vs\Win32\$(Configuration)\ignite.jni.dll')">
-      <Link>resources\$(Configuration)\x86\ignite.jni.dll</Link>
+      <Link>resources\x86\ignite.jni.dll</Link>
     </EmbeddedResource>
   </ItemGroup>
   <ItemGroup>
@@ -537,12 +543,6 @@
   <ItemGroup>
     <Folder Include="Impl\Common\JavaObjects\" />
   </ItemGroup>
-  <ItemGroup>
-    <ProjectReference Include="..\..\cpp\jni\project\vs\jni.vcxproj">
-      <Project>{4f7e4917-4612-4b96-9838-025711ade391}</Project>
-      <Name>jni</Name>
-    </ProjectReference>
-  </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
   <PropertyGroup Condition="'$(Platform)' == 'AnyCPU'">
     <PreBuildEvent>cd "$(ProjectDir)"

http://git-wip-us.apache.org/repos/asf/ignite/blob/87fbb275/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Unmanaged/UnmanagedUtils.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Unmanaged/UnmanagedUtils.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Unmanaged/UnmanagedUtils.cs
index 0a2a1f0..34baee0 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Unmanaged/UnmanagedUtils.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Unmanaged/UnmanagedUtils.cs
@@ -38,9 +38,9 @@ namespace Apache.Ignite.Core.Impl.Unmanaged
         [SuppressMessage("Microsoft.Design", "CA1065:DoNotRaiseExceptionsInUnexpectedLocations")]
         static UnmanagedUtils()
         {
-            var platfrom = Environment.Is64BitProcess ? "x64" : "x86";
+            var platform = Environment.Is64BitProcess ? "x64" : "x86";
 
-            var resName = string.Format("{0}.{1}", platfrom, IgniteUtils.FileIgniteJniDll);
+            var resName = string.Format("{0}.{1}", platform, IgniteUtils.FileIgniteJniDll);
 
             var path = IgniteUtils.UnpackEmbeddedResource(resName, IgniteUtils.FileIgniteJniDll);
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/87fbb275/modules/platforms/dotnet/Apache.Ignite.EntityFramework.Tests/Apache.Ignite.EntityFramework.Tests.csproj
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.EntityFramework.Tests/Apache.Ignite.EntityFramework.Tests.csproj b/modules/platforms/dotnet/Apache.Ignite.EntityFramework.Tests/Apache.Ignite.EntityFramework.Tests.csproj
index 9711087..b03d5f0 100644
--- a/modules/platforms/dotnet/Apache.Ignite.EntityFramework.Tests/Apache.Ignite.EntityFramework.Tests.csproj
+++ b/modules/platforms/dotnet/Apache.Ignite.EntityFramework.Tests/Apache.Ignite.EntityFramework.Tests.csproj
@@ -20,6 +20,7 @@
     <DefineConstants>DEBUG;TRACE</DefineConstants>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
+    <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
     <DebugType>pdbonly</DebugType>
@@ -28,6 +29,7 @@
     <DefineConstants>TRACE</DefineConstants>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
+    <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
   </PropertyGroup>
   <PropertyGroup>
     <SignAssembly>true</SignAssembly>
@@ -35,6 +37,9 @@
   <PropertyGroup>
     <AssemblyOriginatorKeyFile>Apache.Ignite.EntityFramework.Tests.snk</AssemblyOriginatorKeyFile>
   </PropertyGroup>
+  <PropertyGroup>
+    <ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>None</ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
+  </PropertyGroup>
   <ItemGroup>
     <Reference Include="EntityFramework">
       <HintPath>..\packages\EntityFramework.6.1.3\lib\net40\EntityFramework.dll</HintPath>

http://git-wip-us.apache.org/repos/asf/ignite/blob/87fbb275/modules/platforms/dotnet/Apache.Ignite.EntityFramework/Apache.Ignite.EntityFramework.csproj
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.EntityFramework/Apache.Ignite.EntityFramework.csproj b/modules/platforms/dotnet/Apache.Ignite.EntityFramework/Apache.Ignite.EntityFramework.csproj
index 7082182..372c2ed 100644
--- a/modules/platforms/dotnet/Apache.Ignite.EntityFramework/Apache.Ignite.EntityFramework.csproj
+++ b/modules/platforms/dotnet/Apache.Ignite.EntityFramework/Apache.Ignite.EntityFramework.csproj
@@ -21,9 +21,10 @@
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
     <RunCodeAnalysis>true</RunCodeAnalysis>
-    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
     <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
     <DocumentationFile>bin\Debug\Apache.Ignite.EntityFramework.XML</DocumentationFile>
+    <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
     <DebugType>pdbonly</DebugType>
@@ -32,7 +33,8 @@
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
     <DebugType>none</DebugType>
-	<DocumentationFile>bin\Release\Apache.Ignite.EntityFramework.XML</DocumentationFile>
+    <DocumentationFile>bin\Release\Apache.Ignite.EntityFramework.XML</DocumentationFile>
+    <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
   </PropertyGroup>
   <PropertyGroup>
     <SignAssembly>true</SignAssembly>
@@ -40,6 +42,9 @@
   <PropertyGroup>
     <AssemblyOriginatorKeyFile>Apache.Ignite.EntityFramework.snk</AssemblyOriginatorKeyFile>
   </PropertyGroup>
+  <PropertyGroup>
+    <ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>None</ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
+  </PropertyGroup>
   <ItemGroup>
     <Reference Include="EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
       <HintPath>..\packages\EntityFramework.6.1.3\lib\net40\EntityFramework.dll</HintPath>

http://git-wip-us.apache.org/repos/asf/ignite/blob/87fbb275/modules/platforms/dotnet/Apache.Ignite.EntityFramework/Impl/ArrayDbDataReader.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.EntityFramework/Impl/ArrayDbDataReader.cs b/modules/platforms/dotnet/Apache.Ignite.EntityFramework/Impl/ArrayDbDataReader.cs
index 89523f4..0cf31e5 100644
--- a/modules/platforms/dotnet/Apache.Ignite.EntityFramework/Impl/ArrayDbDataReader.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.EntityFramework/Impl/ArrayDbDataReader.cs
@@ -117,6 +117,7 @@ namespace Apache.Ignite.EntityFramework.Impl
         }
 
         /** <inheritDoc /> */
+        [SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods")]
         public override long GetBytes(int ordinal, long dataOffset, byte[] buffer, int bufferOffset, int length)
         {
             Debug.Assert(buffer != null);
@@ -137,6 +138,7 @@ namespace Apache.Ignite.EntityFramework.Impl
         }
 
         /** <inheritDoc /> */
+        [SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods")]
         public override long GetChars(int ordinal, long dataOffset, char[] buffer, int bufferOffset, int length)
         {
             Debug.Assert(buffer != null);
@@ -193,8 +195,11 @@ namespace Apache.Ignite.EntityFramework.Impl
         }
 
         /** <inheritDoc /> */
+        [SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods")]
         public override int GetValues(object[] values)
         {
+            Debug.Assert(values != null);
+
             var row = GetRow();
 
             var size = Math.Min(row.Length, values.Length);

http://git-wip-us.apache.org/repos/asf/ignite/blob/87fbb275/modules/platforms/dotnet/Apache.Ignite.EntityFramework/Impl/DataReaderResult.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.EntityFramework/Impl/DataReaderResult.cs b/modules/platforms/dotnet/Apache.Ignite.EntityFramework/Impl/DataReaderResult.cs
index 48f763c..b683184 100644
--- a/modules/platforms/dotnet/Apache.Ignite.EntityFramework/Impl/DataReaderResult.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.EntityFramework/Impl/DataReaderResult.cs
@@ -21,6 +21,7 @@ namespace Apache.Ignite.EntityFramework.Impl
     using System.Collections.Generic;
     using System.Data;
     using System.Data.Common;
+    using System.Diagnostics.CodeAnalysis;
     using System.Linq;
 
     /// <summary>
@@ -38,6 +39,7 @@ namespace Apache.Ignite.EntityFramework.Impl
         /// <summary>
         /// Initializes a new instance of the <see cref="DataReaderResult"/> class.
         /// </summary>
+        [SuppressMessage("Microsoft.Usage", "CA2202: Do not call Dispose more than one time on an object")]
         public DataReaderResult(IDataReader reader)
         {
             try

http://git-wip-us.apache.org/repos/asf/ignite/blob/87fbb275/modules/platforms/dotnet/Apache.Ignite.EntityFramework/Impl/DbCommandInfo.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.EntityFramework/Impl/DbCommandInfo.cs b/modules/platforms/dotnet/Apache.Ignite.EntityFramework/Impl/DbCommandInfo.cs
index 6b5db05..b80764c 100644
--- a/modules/platforms/dotnet/Apache.Ignite.EntityFramework/Impl/DbCommandInfo.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.EntityFramework/Impl/DbCommandInfo.cs
@@ -21,6 +21,7 @@ namespace Apache.Ignite.EntityFramework.Impl
     using System.Data.Entity.Core.Common.CommandTrees;
     using System.Data.Entity.Core.Metadata.Edm;
     using System.Diagnostics;
+    using System.Diagnostics.CodeAnalysis;
     using System.Linq;
 
     /// <summary>
@@ -166,8 +167,18 @@ namespace Apache.Ignite.EntityFramework.Impl
             public static readonly EntitySetComparer Instance = new EntitySetComparer();
 
             /** <inheritdoc /> */
+            [SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods")]
             public int Compare(EntitySetBase x, EntitySetBase y)
             {
+                if (x == null && y == null)
+                    return 0;
+
+                if (x == null)
+                    return -1;
+
+                if (y == null)
+                    return 1;
+
                 return string.CompareOrdinal(x.Name, y.Name);
             }
         }

http://git-wip-us.apache.org/repos/asf/ignite/blob/87fbb275/modules/platforms/dotnet/Apache.Ignite.EntityFramework/Impl/DbCommandProxy.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.EntityFramework/Impl/DbCommandProxy.cs b/modules/platforms/dotnet/Apache.Ignite.EntityFramework/Impl/DbCommandProxy.cs
index e3353d5..0eb90ae 100644
--- a/modules/platforms/dotnet/Apache.Ignite.EntityFramework/Impl/DbCommandProxy.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.EntityFramework/Impl/DbCommandProxy.cs
@@ -73,6 +73,7 @@ namespace Apache.Ignite.EntityFramework.Impl
         }
 
         /** <inheritDoc /> */
+        [SuppressMessage("Microsoft.Security", "CA2100:Review SQL queries for security vulnerabilities", Justification = "This class is just a proxy.")]
         public override string CommandText
         {
             get { return _command.CommandText; }

http://git-wip-us.apache.org/repos/asf/ignite/blob/87fbb275/modules/platforms/dotnet/Apache.Ignite.Linq/Apache.Ignite.Linq.csproj
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Linq/Apache.Ignite.Linq.csproj b/modules/platforms/dotnet/Apache.Ignite.Linq/Apache.Ignite.Linq.csproj
index 72e050c..04b4916 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Linq/Apache.Ignite.Linq.csproj
+++ b/modules/platforms/dotnet/Apache.Ignite.Linq/Apache.Ignite.Linq.csproj
@@ -21,6 +21,7 @@
     <ErrorReport>prompt</ErrorReport>
     <CodeAnalysisRuleSet>..\Apache.Ignite.Core\Apache.Ignite.Core.ruleset</CodeAnalysisRuleSet>
     <RunCodeAnalysis>false</RunCodeAnalysis>
+    <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
     <OutputPath>bin\Release\</OutputPath>
@@ -30,6 +31,7 @@
     <ErrorReport>prompt</ErrorReport>
     <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
     <DocumentationFile>bin\Release\Apache.Ignite.Linq.XML</DocumentationFile>
+    <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
   </PropertyGroup>
   <PropertyGroup>
     <SignAssembly>true</SignAssembly>
@@ -37,6 +39,9 @@
   <PropertyGroup>
     <AssemblyOriginatorKeyFile>Apache.Ignite.Linq.snk</AssemblyOriginatorKeyFile>
   </PropertyGroup>
+  <PropertyGroup>
+    <ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>None</ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
+  </PropertyGroup>
   <ItemGroup>
     <Reference Include="Remotion.Linq, Version=2.0.0.0, Culture=neutral, PublicKeyToken=fee00910d6e5f53b, processorArchitecture=MSIL">
       <HintPath>..\packages\Remotion.Linq.2.0.1\lib\net40\Remotion.Linq.dll</HintPath>

http://git-wip-us.apache.org/repos/asf/ignite/blob/87fbb275/modules/platforms/dotnet/Apache.Ignite.Log4Net/Apache.Ignite.Log4Net.csproj
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Log4Net/Apache.Ignite.Log4Net.csproj b/modules/platforms/dotnet/Apache.Ignite.Log4Net/Apache.Ignite.Log4Net.csproj
index af5b7e4..142ce73 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Log4Net/Apache.Ignite.Log4Net.csproj
+++ b/modules/platforms/dotnet/Apache.Ignite.Log4Net/Apache.Ignite.Log4Net.csproj
@@ -22,6 +22,7 @@
     <WarningLevel>4</WarningLevel>
     <RunCodeAnalysis>true</RunCodeAnalysis>
     <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+    <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
     <DebugType>none</DebugType>
@@ -30,6 +31,7 @@
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
     <DocumentationFile>bin\Release\Apache.Ignite.Log4Net.XML</DocumentationFile>
+    <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
   </PropertyGroup>
   <PropertyGroup>
     <SignAssembly>true</SignAssembly>
@@ -37,6 +39,9 @@
   <PropertyGroup>
     <AssemblyOriginatorKeyFile>Apache.Ignite.Log4Net.snk</AssemblyOriginatorKeyFile>
   </PropertyGroup>
+  <PropertyGroup>
+    <ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>None</ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
+  </PropertyGroup>
   <ItemGroup>
     <Reference Include="log4net, Version=1.2.15.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
       <HintPath>..\packages\log4net.2.0.5\lib\net40-full\log4net.dll</HintPath>

http://git-wip-us.apache.org/repos/asf/ignite/blob/87fbb275/modules/platforms/dotnet/Apache.Ignite.Log4Net/IgniteLog4NetLogger.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Log4Net/IgniteLog4NetLogger.cs b/modules/platforms/dotnet/Apache.Ignite.Log4Net/IgniteLog4NetLogger.cs
index 058176f..1270600 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Log4Net/IgniteLog4NetLogger.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Log4Net/IgniteLog4NetLogger.cs
@@ -55,7 +55,7 @@ namespace Apache.Ignite.Log4Net
         /// <summary>
         /// Logs the specified message.
         /// </summary>
-        /// <param name="logLevel">The level.</param>
+        /// <param name="level">The level.</param>
         /// <param name="message">The message.</param>
         /// <param name="args">The arguments to format <paramref name="message" />.
         /// Can be null (formatting will not occur).</param>
@@ -63,10 +63,10 @@ namespace Apache.Ignite.Log4Net
         /// <param name="category">The logging category name.</param>
         /// <param name="nativeErrorInfo">The native error information.</param>
         /// <param name="ex">The exception. Can be null.</param>
-        public void Log(LogLevel logLevel, string message, object[] args, IFormatProvider formatProvider, 
+        public void Log(LogLevel level, string message, object[] args, IFormatProvider formatProvider, 
             string category, string nativeErrorInfo, Exception ex)
         {
-            var level = ConvertLogLevel(logLevel);
+            var logLevel = ConvertLogLevel(level);
 
             var repo = _log.Logger.Repository;
 
@@ -74,7 +74,7 @@ namespace Apache.Ignite.Log4Net
                 ? (object) message 
                 : new SystemStringFormat(formatProvider, message, args);
 
-            var evt = new LoggingEvent(GetType(), repo, category, level, messageObject, ex);
+            var evt = new LoggingEvent(GetType(), repo, category, logLevel, messageObject, ex);
 
             if (nativeErrorInfo != null)
                 evt.Properties["nativeErrorInfo"] = nativeErrorInfo;
@@ -85,15 +85,15 @@ namespace Apache.Ignite.Log4Net
         /// <summary>
         /// Determines whether the specified log level is enabled.
         /// </summary>
-        /// <param name="logLevel">The level.</param>
+        /// <param name="level">The level.</param>
         /// <returns>
         /// Value indicating whether the specified log level is enabled
         /// </returns>
-        public bool IsEnabled(LogLevel logLevel)
+        public bool IsEnabled(LogLevel level)
         {
-            var level = ConvertLogLevel(logLevel);
+            var logLevel = ConvertLogLevel(level);
 
-            return _log.Logger.IsEnabledFor(level);
+            return _log.Logger.IsEnabledFor(logLevel);
         }
 
         /// <summary>

http://git-wip-us.apache.org/repos/asf/ignite/blob/87fbb275/modules/platforms/dotnet/Apache.Ignite.NLog/Apache.Ignite.NLog.csproj
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.NLog/Apache.Ignite.NLog.csproj b/modules/platforms/dotnet/Apache.Ignite.NLog/Apache.Ignite.NLog.csproj
index 9fc6ffc..520763b 100644
--- a/modules/platforms/dotnet/Apache.Ignite.NLog/Apache.Ignite.NLog.csproj
+++ b/modules/platforms/dotnet/Apache.Ignite.NLog/Apache.Ignite.NLog.csproj
@@ -20,6 +20,7 @@
     <DefineConstants>DEBUG;TRACE</DefineConstants>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
+    <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
     <DebugType>none</DebugType>
@@ -28,6 +29,7 @@
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
     <DocumentationFile>bin\Release\Apache.Ignite.NLog.XML</DocumentationFile>
+    <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
   </PropertyGroup>
   <PropertyGroup>
     <SignAssembly>true</SignAssembly>
@@ -35,6 +37,9 @@
   <PropertyGroup>
     <AssemblyOriginatorKeyFile>Apache.Ignite.NLog.snk</AssemblyOriginatorKeyFile>
   </PropertyGroup>
+  <PropertyGroup>
+    <ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>None</ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
+  </PropertyGroup>
   <ItemGroup>
     <Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
       <HintPath>..\packages\NLog.4.3.7\lib\net40\NLog.dll</HintPath>

http://git-wip-us.apache.org/repos/asf/ignite/blob/87fbb275/modules/platforms/dotnet/Apache.Ignite.sln
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.sln b/modules/platforms/dotnet/Apache.Ignite.sln
index bcaa753..fe83ccd 100644
--- a/modules/platforms/dotnet/Apache.Ignite.sln
+++ b/modules/platforms/dotnet/Apache.Ignite.sln
@@ -2,6 +2,9 @@
 Microsoft Visual Studio Solution File, Format Version 11.00
 # Visual Studio 2010
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Apache.Ignite.Core", "Apache.Ignite.Core\Apache.Ignite.Core.csproj", "{4CD2F726-7E2B-46C4-A5BA-057BB82EECB6}"
+	ProjectSection(ProjectDependencies) = postProject
+		{4F7E4917-4612-4B96-9838-025711ADE391} = {4F7E4917-4612-4B96-9838-025711ADE391}
+	EndProjectSection
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Apache.Ignite.Core.Tests", "Apache.Ignite.Core.Tests\Apache.Ignite.Core.Tests.csproj", "{6A62F66C-DA5B-4FBB-8CE7-A95F740FDC7A}"
 EndProject

http://git-wip-us.apache.org/repos/asf/ignite/blob/87fbb275/modules/platforms/dotnet/Apache.Ignite/Apache.Ignite.csproj
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite/Apache.Ignite.csproj b/modules/platforms/dotnet/Apache.Ignite/Apache.Ignite.csproj
index e98ddd1..13379f5 100644
--- a/modules/platforms/dotnet/Apache.Ignite/Apache.Ignite.csproj
+++ b/modules/platforms/dotnet/Apache.Ignite/Apache.Ignite.csproj
@@ -23,12 +23,17 @@
     <OutputPath>bin\Debug\</OutputPath>
     <PlatformTarget>AnyCPU</PlatformTarget>
     <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
+    <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
     <OutputPath>bin\Release\</OutputPath>
     <Optimize>true</Optimize>
     <PlatformTarget>AnyCPU</PlatformTarget>
     <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
+    <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
+  </PropertyGroup>
+  <PropertyGroup>
+    <ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>None</ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
   </PropertyGroup>
   <ItemGroup>
     <Reference Include="System" />

http://git-wip-us.apache.org/repos/asf/ignite/blob/87fbb275/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Apache.Ignite.Examples.csproj
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Apache.Ignite.Examples.csproj b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Apache.Ignite.Examples.csproj
index 7d0b438..3f7e1dc 100644
--- a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Apache.Ignite.Examples.csproj
+++ b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Apache.Ignite.Examples.csproj
@@ -35,6 +35,9 @@
     <PlatformTarget>AnyCPU</PlatformTarget>
     <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
   </PropertyGroup>
+  <PropertyGroup>
+    <ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>None</ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
+  </PropertyGroup>
   <ItemGroup>
     <Reference Include="Apache.Ignite.Core">
       <HintPath Condition="Exists('..\..\Apache.Ignite')">..\..\Apache.Ignite\bin\$(Configuration)\Apache.Ignite.Core.dll</HintPath>

http://git-wip-us.apache.org/repos/asf/ignite/blob/87fbb275/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Apache.Ignite.ExamplesDll.csproj
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Apache.Ignite.ExamplesDll.csproj b/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Apache.Ignite.ExamplesDll.csproj
index 8515bf6..6ea6227 100644
--- a/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Apache.Ignite.ExamplesDll.csproj
+++ b/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Apache.Ignite.ExamplesDll.csproj
@@ -11,6 +11,7 @@
     <AssemblyName>Apache.Ignite.ExamplesDll</AssemblyName>
     <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
     <FileAlignment>512</FileAlignment>
+    <NoWarn>649</NoWarn>
   </PropertyGroup>
   <PropertyGroup>
     <SignAssembly>true</SignAssembly>
@@ -32,6 +33,9 @@
     <PlatformTarget>AnyCPU</PlatformTarget>
     <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
   </PropertyGroup>
+  <PropertyGroup>
+    <ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>None</ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
+  </PropertyGroup>
   <ItemGroup>
     <Reference Include="Apache.Ignite.Core">
       <HintPath Condition="Exists('..\..\Apache.Ignite')">..\..\Apache.Ignite\bin\$(Configuration)\Apache.Ignite.Core.dll</HintPath>

http://git-wip-us.apache.org/repos/asf/ignite/blob/87fbb275/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Services/MapService.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Services/MapService.cs b/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Services/MapService.cs
index 958d91d..7071cd4 100644
--- a/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Services/MapService.cs
+++ b/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Services/MapService.cs
@@ -30,9 +30,7 @@ namespace Apache.Ignite.ExamplesDll.Services
     public class MapService<TK, TV> : IService
     {
         /** Injected Ignite instance. */
-#pragma warning disable 649
         [InstanceResource] private readonly IIgnite _ignite;
-#pragma warning restore 649
 
         /** Cache. */
         private ICache<TK, TV> _cache;


[8/9] ignite git commit: completing from user thread

Posted by yz...@apache.org.
completing from user thread


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/3cc6c295
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/3cc6c295
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/3cc6c295

Branch: refs/heads/ignite-comm-balance-master
Commit: 3cc6c2954a2102e06583f92ed84eccac9d096bff
Parents: 8f98e62
Author: Yakov Zhdanov <yz...@gridgain.com>
Authored: Wed Jan 11 17:21:07 2017 +0300
Committer: Yakov Zhdanov <yz...@gridgain.com>
Committed: Wed Jan 11 17:21:07 2017 +0300

----------------------------------------------------------------------
 .../managers/communication/GridIoManager.java   | 35 +++++++++++++++-----
 1 file changed, 26 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/3cc6c295/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java b/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java
index d50a5be..56cefdf 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java
@@ -40,7 +40,6 @@ import java.util.concurrent.locks.ReadWriteLock;
 import java.util.concurrent.locks.ReentrantReadWriteLock;
 import org.apache.ignite.IgniteCheckedException;
 import org.apache.ignite.IgniteException;
-import org.apache.ignite.IgniteSystemProperties;
 import org.apache.ignite.cluster.ClusterNode;
 import org.apache.ignite.events.DiscoveryEvent;
 import org.apache.ignite.events.Event;
@@ -68,6 +67,7 @@ import org.apache.ignite.internal.util.lang.GridTuple3;
 import org.apache.ignite.internal.util.tostring.GridToStringInclude;
 import org.apache.ignite.internal.util.typedef.F;
 import org.apache.ignite.internal.util.typedef.X;
+import org.apache.ignite.internal.util.typedef.internal.CU;
 import org.apache.ignite.internal.util.typedef.internal.S;
 import org.apache.ignite.internal.util.typedef.internal.U;
 import org.apache.ignite.lang.IgniteBiPredicate;
@@ -315,7 +315,7 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
         if (log.isDebugEnabled())
             log.debug(startInfo());
 
-        U.debug(log, "COMPLETE_IN_USER_THREAD: " + COMPLETE_IN_USER_THREAD);
+        U.debug(log, "COMPLETE_IN_USER_THREAD for cache ID: " + COMPLETE_IN_USER_THREAD_ID);
 
         addMessageListener(GridTopic.TOPIC_IO_TEST, new GridMessageListener() {
             @Override public void onMessage(UUID nodeId, Object msg) {
@@ -764,7 +764,20 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
         }
     }
 
-    private static final boolean COMPLETE_IN_USER_THREAD = IgniteSystemProperties.getBoolean("COMPLETE_IN_USER_THREAD", false);
+    private static final int COMPLETE_IN_USER_THREAD_ID;
+
+    static {
+        String cacheName = System.getProperty("COMPLETE_IN_USER_THREAD");
+
+        if (cacheName == null)
+            COMPLETE_IN_USER_THREAD_ID = 0;
+        else {
+            COMPLETE_IN_USER_THREAD_ID = CU.cacheId(cacheName);
+
+            if (COMPLETE_IN_USER_THREAD_ID == 0)
+                throw new RuntimeException();
+        }
+    }
 
     /**
      * @param nodeId Node ID.
@@ -809,17 +822,21 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
             return;
         }
 
-        if (COMPLETE_IN_USER_THREAD && msg.message() instanceof GridNearAtomicUpdateResponse) {
+        if (COMPLETE_IN_USER_THREAD_ID != 0 &&
+            msg.message().directType() == 41 // instanceof GridNearAtomicUpdateResponse
+            ) {
             GridNearAtomicUpdateResponse res = (GridNearAtomicUpdateResponse)msg.message();
 
-            GridNearAtomicAbstractUpdateFuture f =
-                (GridNearAtomicAbstractUpdateFuture)ctx.cache().context().mvcc().atomicFuture(res.futureVersion());
+            if (res.cacheId() == COMPLETE_IN_USER_THREAD_ID) {
+                GridNearAtomicAbstractUpdateFuture f =
+                    (GridNearAtomicAbstractUpdateFuture)ctx.cache().context().mvcc().atomicFuture(res.futureVersion());
 
-            f.completer(c);
+                f.completer(c);
 
-            f.unblockAllThreads();
+                f.unblockAllThreads();
 
-            return;
+                return;
+            }
         }
 
         if (ctx.config().getStripedPoolSize() > 0 &&