ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From voze...@apache.org
Subject [1/2] ignite git commit: IGNITE-2805: CPP: Added transactions API. This closes #645.
Date Wed, 11 May 2016 06:32:35 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-1.6 949f0a47b -> bc143c6aa


http://git-wip-us.apache.org/repos/asf/ignite/blob/bc143c6a/modules/platforms/cpp/core/include/ignite/impl/transactions/transactions_impl.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core/include/ignite/impl/transactions/transactions_impl.h b/modules/platforms/cpp/core/include/ignite/impl/transactions/transactions_impl.h
new file mode 100644
index 0000000..651c64f
--- /dev/null
+++ b/modules/platforms/cpp/core/include/ignite/impl/transactions/transactions_impl.h
@@ -0,0 +1,138 @@
+/*
+ * 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_IMPL_TRANSACTIONS_TRANSACTIONS_IMPL
+#define _IGNITE_IMPL_TRANSACTIONS_TRANSACTIONS_IMPL
+
+#include <ignite/common/concurrent.h>
+#include <ignite/jni/java.h>
+#include <ignite/transactions/transaction_consts.h>
+#include <ignite/transactions/transaction_metrics.h>
+
+#include <ignite/impl/interop/interop_target.h>
+
+namespace ignite 
+{
+    namespace impl
+    {
+        namespace transactions
+        {
+            /**
+             * Transactions implementation.
+             */
+            class IGNITE_FRIEND_EXPORT TransactionsImpl : private interop::InteropTarget
+            {
+                typedef ignite::common::concurrent::SharedPointer<ignite::impl::IgniteEnvironment> SP_IgniteEnvironment;
+                typedef ignite::transactions::TransactionState TransactionState;
+            public:
+                /**
+                 * Constructor used to create new instance.
+                 *
+                 * @param env Environment.
+                 * @param javaRef Reference to java object.
+                 */
+                TransactionsImpl(SP_IgniteEnvironment env, jobject javaRef);
+
+                /**
+                 * Destructor.
+                 */
+                ~TransactionsImpl();
+
+                /**
+                 * Start new transaction.
+                 *
+                 * @param concurrency Concurrency.
+                 * @param isolation Isolation.
+                 * @param timeout Timeout in milliseconds. Zero if for infinite timeout.
+                 * @param txSize Number of entries participating in transaction (may be approximate).
+                 * @param err Error.
+                 * @return Transaction ID on success.
+                 */
+                int64_t TxStart(int concurrency, int isolation, int64_t timeout,
+                    int32_t txSize, IgniteError& err);
+
+                /**
+                 * Commit Transaction.
+                 *
+                 * @param id Transaction ID.
+                 * @param err Error.
+                 * @return Resulting state.
+                 */
+                TransactionState TxCommit(int64_t id, IgniteError& err);
+
+                /**
+                 * Rollback Transaction.
+                 *
+                 * @param id Transaction ID.
+                 * @param err Error.
+                 * @return Resulting state.
+                 */
+                TransactionState TxRollback(int64_t id, IgniteError& err);
+
+                /**
+                 * Close Transaction.
+                 *
+                 * @param id Transaction ID.
+                 * @param err Error.
+                 * @return Resulting state.
+                 */
+                TransactionState TxClose(int64_t id, IgniteError& err);
+
+                /**
+                 * Make transaction into rollback-only.
+                 *
+                 * After transaction have been marked as rollback-only it may
+                 * only be rolled back. Error occurs if such transaction is
+                 * being commited.
+                 *
+                 * @param err Error.
+                 * @return True if rollback-only has been set.
+                 */
+                bool TxSetRollbackOnly(int64_t id, IgniteError& err);
+
+                /**
+                 * Get Transaction state.
+                 *
+                 * @param id Transaction ID.
+                 * @return Resulting state.
+                 */
+                TransactionState TxState(int64_t id, IgniteError& err);
+
+                /**
+                 * Get metrics.
+                 *
+                 * @param err Error.
+                 * @return Metrics instance.
+                 */
+                ignite::transactions::TransactionMetrics GetMetrics(IgniteError& err);
+
+            private:
+                /**
+                 * Convert integer state constant to that of the TransactionState.
+                 *
+                 * @param state Integer constant state.
+                 * @return TransactionState constant.
+                 */
+                TransactionState ToTransactionState(int state);
+
+                IGNITE_NO_COPY_ASSIGNMENT(TransactionsImpl)
+            };
+        }
+    }
+}
+
+#endif //_IGNITE_IMPL_TRANSACTIONS_TRANSACTIONS_IMPL
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/bc143c6a/modules/platforms/cpp/core/include/ignite/transactions/transaction.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core/include/ignite/transactions/transaction.h b/modules/platforms/cpp/core/include/ignite/transactions/transaction.h
new file mode 100644
index 0000000..f68470e
--- /dev/null
+++ b/modules/platforms/cpp/core/include/ignite/transactions/transaction.h
@@ -0,0 +1,214 @@
+/*
+ * 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.
+ */
+
+/**
+ * @file
+ * Declares ignite::transactions::Transaction class.
+ */
+
+#ifndef _IGNITE_TRANSACTIONS_TRANSACTION
+#define _IGNITE_TRANSACTIONS_TRANSACTION
+
+#include <ignite/common/concurrent.h>
+#include <ignite/jni/java.h>
+
+#include "ignite/impl/transactions/transaction_impl.h"
+#include "ignite/transactions/transaction_consts.h"
+
+namespace ignite
+{
+    namespace transactions
+    {
+        /**
+         * Transaction.
+         */
+        class IGNITE_FRIEND_EXPORT Transaction
+        {
+        public:
+            /**
+             * Constructor.
+             */
+            Transaction(common::concurrent::SharedPointer<impl::transactions::TransactionImpl> impl);
+
+            /**
+             * Copy constructor.
+             *
+             * @param other Other instance.
+             */
+            Transaction(const Transaction& other);
+
+            /**
+             * Assignment operator.
+             *
+             * @param other Other instance.
+             * @return This.
+             */
+            Transaction& operator=(const Transaction& other);
+
+            /**
+             * Destructor.
+             */
+            ~Transaction();
+
+            /**
+             * Commit the transaction.
+             */
+            void Commit();
+
+            /**
+             * Commit the transaction.
+             *
+             * @param err Error.
+             */
+            void Commit(IgniteError& err);
+
+            /**
+             * Rollback the transaction.
+             */
+            void Rollback();
+
+            /**
+             * Rollback the transaction.
+             *
+             * @param err Error.
+             */
+            void Rollback(IgniteError& err);
+
+            /**
+             * Close the transaction.
+             */
+            void Close();
+
+            /**
+             * Close the transaction.
+             *
+             * @param err Error.
+             */
+            void Close(IgniteError& err);
+
+            /**
+             * Make transaction into rollback-only.
+             *
+             * After transaction have been marked as rollback-only it may
+             * only be rolled back. Error occurs if such transaction is
+             * being commited.
+             */
+            void SetRollbackOnly();
+
+            /**
+             * Make transaction into rollback-only.
+             *
+             * After transaction have been marked as rollback-only it may
+             * only be rolled back. Error occurs if such transaction is
+             * being commited.
+             *
+             * @param err Error.
+             */
+            void SetRollbackOnly(IgniteError& err);
+
+            /**
+             * Check if the transaction is rollback-only.
+             *
+             * After transaction have been marked as rollback-only it may
+             * only be rolled back. Error occurs if such transaction is
+             * being commited.
+             *
+             * @return True if the transaction is rollback-only.
+             */
+            bool IsRollbackOnly();
+
+            /**
+             * Check if the transaction is rollback-only.
+             *
+             * After transaction have been marked as rollback-only it may
+             * only be rolled back. Error occurs if such transaction is
+             * being commited.
+             *
+             * @param err Error.
+             * @return True if the transaction is rollback-only.
+             */
+            bool IsRollbackOnly(IgniteError& err);
+
+            /**
+             * Get current state.
+             *
+             * @return Transaction state.
+             */
+            TransactionState GetState();
+
+            /**
+             * Get current state.
+             *
+             * @param err Error.
+             * @return Transaction state.
+             */
+            TransactionState GetState(IgniteError& err);
+
+            /**
+             * Get concurrency.
+             *
+             * @return Concurrency.
+             */
+            TransactionConcurrency GetConcurrency() const
+            {
+                return static_cast<TransactionConcurrency>(impl.Get()->GetConcurrency());
+            }
+
+            /**
+             * Get isolation.
+             *
+             * @return Isolation.
+             */
+            TransactionIsolation GetIsolation() const
+            {
+                return static_cast<TransactionIsolation>(impl.Get()->GetIsolation());
+            }
+
+            /**
+             * Get timeout.
+             *
+             * @return Timeout in milliseconds. Zero if timeout is infinite.
+             */
+            int64_t GetTimeout() const
+            {
+                return impl.Get()->GetTimeout();
+            }
+
+            /**
+             * Check if the instance is valid and can be used.
+             *
+             * Invalid instance can be returned if some of the previous
+             * operations have resulted in a failure. For example invalid
+             * instance can be returned by not-throwing version of method
+             * in case of error. Invalid instances also often can be
+             * created using default constructor.
+             *
+             * @return True if the instance is valid and can be used.
+             */
+            bool IsValid() const
+            {
+                return impl.IsValid();
+            }
+
+        private:
+            /** Implementation delegate. */
+            common::concurrent::SharedPointer<impl::transactions::TransactionImpl> impl;
+        };
+    }
+}
+
+#endif //_IGNITE_TRANSACTIONS_TRANSACTION
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/bc143c6a/modules/platforms/cpp/core/include/ignite/transactions/transaction_consts.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core/include/ignite/transactions/transaction_consts.h b/modules/platforms/cpp/core/include/ignite/transactions/transaction_consts.h
new file mode 100644
index 0000000..5799b9f
--- /dev/null
+++ b/modules/platforms/cpp/core/include/ignite/transactions/transaction_consts.h
@@ -0,0 +1,92 @@
+/*
+ * 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.
+ */
+
+/**
+ * @file
+ * Declares ignite::transactions::TransactionState enumeration.
+ */
+
+#ifndef _IGNITE_TRANSACTIONS_TRANSACTION_CONSTS
+#define _IGNITE_TRANSACTIONS_TRANSACTION_CONSTS
+
+namespace ignite 
+{
+    namespace transactions
+    {
+        /**
+         * Transaction concurrency control.
+         */
+        enum TransactionConcurrency
+        {
+            /** Optimistic concurrency control. */
+            IGNITE_TX_CONCURRENCY_OPTIMISTIC = 0,
+
+            /** Pessimistic concurrency control. */
+            IGNITE_TX_CONCURRENCY_PESSIMISTIC = 1
+        };
+
+        /**
+         * Defines different cache transaction isolation levels.
+         */
+        enum TransactionIsolation
+        {
+            /** Read committed isolation level. */
+            IGNITE_TX_ISOLATION_READ_COMMITTED = 0,
+
+            /** Repeatable read isolation level. */
+            IGNITE_TX_ISOLATION_REPEATABLE_READ = 1,
+
+            /** Serializable isolation level. */
+            IGNITE_TX_ISOLATION_SERIALIZABLE = 2
+        };
+
+        /**
+         * Cache transaction state.
+         */
+        enum TransactionState
+        {
+            /** Transaction started. */
+            IGNITE_TX_STATE_ACTIVE,
+
+            /** Transaction validating. */
+            IGNITE_TX_STATE_PREPARING,
+
+            /** Transaction validation succeeded. */
+            IGNITE_TX_STATE_PREPARED,
+
+            /** Transaction is marked for rollback. */
+            IGNITE_TX_STATE_MARKED_ROLLBACK,
+
+            /** Transaction commit started (validating finished). */
+            IGNITE_TX_STATE_COMMITTING,
+
+            /** Transaction commit succeeded. */
+            IGNITE_TX_STATE_COMMITTED,
+
+            /** Transaction rollback started (validation failed). */
+            IGNITE_TX_STATE_ROLLING_BACK,
+
+            /** Transaction rollback succeeded. */
+            IGNITE_TX_STATE_ROLLED_BACK,
+
+            /** Transaction rollback failed or is otherwise unknown state. */
+            IGNITE_TX_STATE_UNKNOWN
+        };
+    }
+}
+
+#endif //_IGNITE_TRANSACTIONS_TRANSACTION_CONSTS
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/bc143c6a/modules/platforms/cpp/core/include/ignite/transactions/transaction_metrics.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core/include/ignite/transactions/transaction_metrics.h b/modules/platforms/cpp/core/include/ignite/transactions/transaction_metrics.h
new file mode 100644
index 0000000..4986a64
--- /dev/null
+++ b/modules/platforms/cpp/core/include/ignite/transactions/transaction_metrics.h
@@ -0,0 +1,174 @@
+/*
+ * 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.
+ */
+
+/**
+ * @file
+ * Declares ignite::transactions::TransactionMetrics class.
+ */
+
+#ifndef _IGNITE_TRANSACTIONS_TRANSACTION_METRICS
+#define _IGNITE_TRANSACTIONS_TRANSACTION_METRICS
+
+#include <stdint.h>
+
+#include <ignite/timestamp.h>
+
+namespace ignite
+{
+    namespace transactions
+    {
+        /**
+         * Transaction metrics.
+         */
+        class IGNITE_IMPORT_EXPORT TransactionMetrics
+        {
+        public:
+            /**
+             * Default constructor.
+             */
+            TransactionMetrics() :
+                valid(false),
+                commitTime(),
+                rollbackTime(),
+                commits(),
+                rollbacks()
+            {
+                // No-op.
+            }
+
+            /**
+             * Constructor.
+             *
+             * @param commitTime The last time transaction was committed.
+             * @param rollbackTime The last time transaction was rolled back.
+             * @param commits The total number of transaction commits.
+             * @param rollbacks The total number of transaction rollbacks.
+             */
+            TransactionMetrics(const Timestamp& commitTime,
+                const Timestamp& rollbackTime, int32_t commits, int32_t rollbacks) :
+                valid(true),
+                commitTime(commitTime),
+                rollbackTime(rollbackTime),
+                commits(commits),
+                rollbacks(rollbacks)
+            {
+                //No-op.
+            }
+
+            /**
+             * Copy constructor.
+             */
+            TransactionMetrics(const TransactionMetrics& other) :
+                valid(other.valid),
+                commitTime(other.commitTime),
+                rollbackTime(other.rollbackTime),
+                commits(other.commits),
+                rollbacks(other.rollbacks)
+            {
+                // No-op.
+            }
+
+            /**
+             * Assignment operator.
+             */
+            TransactionMetrics& operator=(const TransactionMetrics& other)
+            {
+                valid = other.valid;
+                commitTime = other.commitTime;
+                rollbackTime = other.rollbackTime;
+                commits = other.commits;
+                rollbacks = other.rollbacks;
+
+                return *this;
+            }
+
+            /**
+             * Get commit time.
+             *
+             * @return The last time transaction was committed.
+             */
+            const Timestamp& GetCommitTime() const
+            {
+                return commitTime;
+            }
+            
+            /**
+             * Get rollback time.
+             *
+             * @return The last time transaction was rolled back.
+             */
+            const Timestamp& GetRollbackTime() const
+            {
+                return rollbackTime;
+            }
+
+            /**
+             * Get the total number of transaction commits.
+             *
+             * @return The total number of transaction commits.
+             */
+            int32_t GetCommits() const
+            {
+                return commits;
+            }
+
+            /**
+             * Get the total number of transaction rollbacks.
+             *
+             * @return The total number of transaction rollbacks.
+             */
+            int32_t GetRollbacks() const
+            {
+                return rollbacks;
+            }
+
+            /**
+             * Check wheather the instance is valid.
+             *
+             * Invalid instance can be returned if some of the previous
+             * operations have resulted in a failure. For example invalid
+             * instance can be returned by not-throwing version of method
+             * in case of error. Invalid instances also often can be
+             * created using default constructor.
+             *
+             * @return True if the instance contains valid data.
+             */
+            bool IsValid() const
+            {
+                return valid;
+            }
+
+        private:
+            /** Wheather instance is valid. */
+            bool valid;
+
+            /** The last time transaction was committed. */
+            Timestamp commitTime;
+
+            /** The last time transaction was rolled back. */
+            Timestamp rollbackTime;
+
+            /** The total number of transaction commits. */
+            int32_t commits;
+
+            /** The total number of transaction rollbacks. */
+            int32_t rollbacks;
+        };
+    }
+}
+
+#endif //_IGNITE_TRANSACTIONS_TRANSACTION_METRICS
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/bc143c6a/modules/platforms/cpp/core/include/ignite/transactions/transactions.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core/include/ignite/transactions/transactions.h b/modules/platforms/cpp/core/include/ignite/transactions/transactions.h
new file mode 100644
index 0000000..130116a
--- /dev/null
+++ b/modules/platforms/cpp/core/include/ignite/transactions/transactions.h
@@ -0,0 +1,164 @@
+/*
+ * 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.
+ */
+
+/**
+ * @file
+ * Declares ignite::transactions::Transactions class.
+ */
+
+#ifndef _IGNITE_TRANSACTIONS_TRANSACTIONS
+#define _IGNITE_TRANSACTIONS_TRANSACTIONS
+
+#include <ignite/common/concurrent.h>
+#include <ignite/jni/java.h>
+
+#include "ignite/transactions/transaction.h"
+#include "ignite/transactions/transaction_metrics.h"
+#include "ignite/impl/transactions/transactions_impl.h"
+
+namespace ignite
+{
+    namespace transactions
+    {
+        /**
+         * Transactions.
+         */
+        class IGNITE_FRIEND_EXPORT Transactions
+        {
+        public:
+            /**
+             * Constructor.
+             */
+            Transactions(ignite::common::concurrent::SharedPointer<impl::transactions::TransactionsImpl> impl);
+
+            /**
+             * Copy constructor.
+             *
+             * @param other Other instance.
+             */
+            Transactions(const Transactions& other);
+
+            /**
+             * Assignment operator.
+             *
+             * @param other Other instance.
+             * @return This.
+             */
+            Transactions& operator=(const Transactions& other);
+
+            /**
+             * Destructor.
+             */
+            ~Transactions();
+
+            /**
+             * Get active transaction for the current thread.
+             *
+             * @return Active transaction for current thread.
+             * Returned instance is not valid if there is no active transaction
+             * for the thread.
+             */
+            Transaction GetTx();
+
+            /**
+             * Start new transaction.
+             *
+             * @return New transaction instance.
+             */
+            Transaction TxStart();
+
+            /**
+             * Start new transaction.
+             *
+             * @param err Error.
+             * @return New transaction instance.
+             */
+            Transaction TxStart(IgniteError& err);
+
+            /**
+             * Start new transaction.
+             *
+             * @param concurrency Concurrency.
+             * @param isolation Isolation.
+             * @return New transaction instance.
+             */
+            Transaction TxStart(TransactionConcurrency concurrency,
+                TransactionIsolation isolation);
+
+            /**
+             * Start new transaction.
+             *
+             * @param concurrency Concurrency.
+             * @param isolation Isolation.
+             * @param err Error.
+             * @return New transaction instance.
+             */
+            Transaction TxStart(TransactionConcurrency concurrency,
+                TransactionIsolation isolation, IgniteError& err);
+
+            /**
+             * Start new transaction.
+             *
+             * @param concurrency Concurrency.
+             * @param isolation Isolation.
+             * @param timeout Timeout. Zero if for infinite timeout.
+             * @param txSize Number of entries participating in transaction (may be approximate).
+             * @return New transaction instance.
+             */
+            Transaction TxStart(TransactionConcurrency concurrency,
+                TransactionIsolation isolation, int64_t timeout,
+                int32_t txSize);
+
+            /**
+             * Start new transaction.
+             *
+             * @param concurrency Concurrency.
+             * @param isolation Isolation.
+             * @param timeout Timeout. Zero if for infinite timeout.
+             * @param txSize Number of entries participating in transaction (may be approximate).
+             * @param err Error.
+             * @return New transaction instance.
+             */
+            Transaction TxStart(TransactionConcurrency concurrency,
+                TransactionIsolation isolation, int64_t timeout,
+                int32_t txSize, IgniteError& err);
+
+            /**
+             * Get metrics.
+             *
+             * @return Metrics instance.
+             */
+            TransactionMetrics GetMetrics();
+
+            /**
+             * Get metrics.
+             *
+             * @param err Error.
+             * @return Metrics instance.
+             * Returned instance is not valid if an error occurred during
+             * the operation.
+             */
+            TransactionMetrics GetMetrics(IgniteError& err);
+
+        private:
+            /** Implementation delegate. */
+            ignite::common::concurrent::SharedPointer<impl::transactions::TransactionsImpl> impl;
+        };
+    }
+}
+
+#endif //_IGNITE_TRANSACTIONS_TRANSACTIONS
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/bc143c6a/modules/platforms/cpp/core/namespaces.dox
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core/namespaces.dox b/modules/platforms/cpp/core/namespaces.dox
index ed237f6..20aa5ba 100644
--- a/modules/platforms/cpp/core/namespaces.dox
+++ b/modules/platforms/cpp/core/namespaces.dox
@@ -35,6 +35,14 @@
 	 {
 		 // Empty.
 	 }
+
+	 /**
+	  * %Ignite Transaction API.
+	  */
+	 namespace transactions
+	 {
+		 // Empty.
+	 }
 	 
 	 /**
 	  * %Ignite %Cache API.
@@ -50,4 +58,4 @@
 		 }
 	 }
  }
- 
\ No newline at end of file
+ 

http://git-wip-us.apache.org/repos/asf/ignite/blob/bc143c6a/modules/platforms/cpp/core/project/vs/core.vcxproj
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core/project/vs/core.vcxproj b/modules/platforms/cpp/core/project/vs/core.vcxproj
index dccd33c..0797c31 100644
--- a/modules/platforms/cpp/core/project/vs/core.vcxproj
+++ b/modules/platforms/cpp/core/project/vs/core.vcxproj
@@ -215,7 +215,14 @@
     <ClInclude Include="..\..\include\ignite\impl\ignite_impl.h" />
     <ClInclude Include="..\..\include\ignite\impl\handle_registry.h" />
     <ClInclude Include="..\..\include\ignite\impl\interop\interop_external_memory.h" />
+    <ClInclude Include="..\..\include\ignite\impl\interop\interop_target.h" />
     <ClInclude Include="..\..\include\ignite\impl\operations.h" />
+    <ClInclude Include="..\..\include\ignite\impl\transactions\transactions_impl.h" />
+    <ClInclude Include="..\..\include\ignite\impl\transactions\transaction_impl.h" />
+    <ClInclude Include="..\..\include\ignite\transactions\transaction.h" />
+    <ClInclude Include="..\..\include\ignite\transactions\transactions.h" />
+    <ClInclude Include="..\..\include\ignite\transactions\transaction_consts.h" />
+    <ClInclude Include="..\..\include\ignite\transactions\transaction_metrics.h" />
   </ItemGroup>
   <ItemGroup>
     <ClCompile Include="..\..\src\ignite.cpp" />
@@ -227,6 +234,11 @@
     <ClCompile Include="..\..\src\impl\ignite_impl.cpp" />
     <ClCompile Include="..\..\src\impl\handle_registry.cpp" />
     <ClCompile Include="..\..\src\impl\interop\interop_external_memory.cpp" />
+    <ClCompile Include="..\..\src\impl\interop\interop_target.cpp" />
+    <ClCompile Include="..\..\src\impl\transactions\transactions_impl.cpp" />
+    <ClCompile Include="..\..\src\impl\transactions\transaction_impl.cpp" />
+    <ClCompile Include="..\..\src\transactions\transaction.cpp" />
+    <ClCompile Include="..\..\src\transactions\transactions.cpp" />
   </ItemGroup>
   <ItemGroup>
     <ProjectReference Include="..\..\..\binary\project\vs\binary.vcxproj">

http://git-wip-us.apache.org/repos/asf/ignite/blob/bc143c6a/modules/platforms/cpp/core/project/vs/core.vcxproj.filters
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core/project/vs/core.vcxproj.filters b/modules/platforms/cpp/core/project/vs/core.vcxproj.filters
index 96893bc..c90b697 100644
--- a/modules/platforms/cpp/core/project/vs/core.vcxproj.filters
+++ b/modules/platforms/cpp/core/project/vs/core.vcxproj.filters
@@ -28,6 +28,21 @@
     <ClCompile Include="..\..\src\impl\binary\binary_type_updater_impl.cpp">
       <Filter>Code\impl\binary</Filter>
     </ClCompile>
+    <ClCompile Include="..\..\src\impl\transactions\transactions_impl.cpp">
+      <Filter>Code\impl\transactions</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\transactions\transactions.cpp">
+      <Filter>Code\transactions</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\impl\transactions\transaction_impl.cpp">
+      <Filter>Code\impl\transactions</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\transactions\transaction.cpp">
+      <Filter>Code\transactions</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\impl\interop\interop_target.cpp">
+      <Filter>Code\impl\interop</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="..\..\include\ignite\impl\cache\cache_impl.h">
@@ -102,6 +117,27 @@
     <ClInclude Include="..\..\include\ignite\impl\interop\interop_external_memory.h">
       <Filter>Code\impl\interop</Filter>
     </ClInclude>
+    <ClInclude Include="..\..\include\ignite\impl\transactions\transactions_impl.h">
+      <Filter>Code\impl\transactions</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\include\ignite\transactions\transactions.h">
+      <Filter>Code\transactions</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\include\ignite\transactions\transaction.h">
+      <Filter>Code\transactions</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\include\ignite\impl\transactions\transaction_impl.h">
+      <Filter>Code\impl\transactions</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\include\ignite\transactions\transaction_consts.h">
+      <Filter>Code\transactions</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\include\ignite\transactions\transaction_metrics.h">
+      <Filter>Code\transactions</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\include\ignite\impl\interop\interop_target.h">
+      <Filter>Code\impl\interop</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <Filter Include="Code">
@@ -128,5 +164,11 @@
     <Filter Include="Code\impl\binary">
       <UniqueIdentifier>{25234d34-541b-4f6c-b42a-cc96ee33a928}</UniqueIdentifier>
     </Filter>
+    <Filter Include="Code\impl\transactions">
+      <UniqueIdentifier>{d6f8a3d2-db0e-45ff-9f39-d1f1fa8771f8}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="Code\transactions">
+      <UniqueIdentifier>{146fe661-0ad3-4d51-83a3-fce8a897e84d}</UniqueIdentifier>
+    </Filter>
   </ItemGroup>
 </Project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/bc143c6a/modules/platforms/cpp/core/src/ignite.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core/src/ignite.cpp b/modules/platforms/cpp/core/src/ignite.cpp
index 0871661..c546ea5 100644
--- a/modules/platforms/cpp/core/src/ignite.cpp
+++ b/modules/platforms/cpp/core/src/ignite.cpp
@@ -39,5 +39,15 @@ namespace ignite
     {
         return impl.Get()->GetName();
     }
+
+    transactions::Transactions Ignite::GetTransactions()
+    {
+        using ignite::common::concurrent::SharedPointer;
+        using ignite::impl::transactions::TransactionsImpl;
+
+        SharedPointer<TransactionsImpl> txImpl = impl.Get()->GetTransactions();
+
+        return transactions::Transactions(txImpl);
+    }
 }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/bc143c6a/modules/platforms/cpp/core/src/impl/cache/cache_impl.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core/src/impl/cache/cache_impl.cpp b/modules/platforms/cpp/core/src/impl/cache/cache_impl.cpp
index fec41e7..e728f55 100644
--- a/modules/platforms/cpp/core/src/impl/cache/cache_impl.cpp
+++ b/modules/platforms/cpp/core/src/impl/cache/cache_impl.cpp
@@ -121,7 +121,8 @@ namespace ignite
             const int32_t OP_REPLACE_3 = 38;
 
             CacheImpl::CacheImpl(char* name, SharedPointer<IgniteEnvironment> env, jobject javaRef) :
-                name(name), env(env), javaRef(javaRef)
+                InteropTarget(env, javaRef),
+                name(name)
             {
                 // No-op.
             }
@@ -130,7 +131,7 @@ namespace ignite
             {
                 ReleaseChars(name);
 
-                JniContext::Release(javaRef);
+                JniContext::Release(GetTarget());
             }
 
             const char* CacheImpl::GetName() const
@@ -145,128 +146,128 @@ namespace ignite
 
             bool CacheImpl::ContainsKey(InputOperation& inOp, IgniteError* err)
             {
-                return OutOpInternal(OP_CONTAINS_KEY, inOp, err);
+                return OutOp(OP_CONTAINS_KEY, inOp, err);
             }
 
             bool CacheImpl::ContainsKeys(InputOperation& inOp, IgniteError* err)
             {
-                return OutOpInternal(OP_CONTAINS_KEYS, inOp, err);
+                return OutOp(OP_CONTAINS_KEYS, inOp, err);
             }
 
             void CacheImpl::LocalPeek(InputOperation& inOp, OutputOperation& outOp, int32_t peekModes, IgniteError* err)
             {
-                OutInOpInternal(OP_LOCAL_PEEK, inOp, outOp, err);
+                OutInOp(OP_LOCAL_PEEK, inOp, outOp, err);
             }
 
             void CacheImpl::Get(InputOperation& inOp, OutputOperation& outOp, IgniteError* err)
             {
-                OutInOpInternal(OP_GET, inOp, outOp, err);
+                OutInOp(OP_GET, inOp, outOp, err);
             }
 
             void CacheImpl::GetAll(InputOperation& inOp, OutputOperation& outOp, IgniteError* err)
             {
-                OutInOpInternal(OP_GET_ALL, inOp, outOp, err);
+                OutInOp(OP_GET_ALL, inOp, outOp, err);
             }
 
             void CacheImpl::Put(InputOperation& inOp, IgniteError* err)
             {
-                OutOpInternal(OP_PUT, inOp, err);
+                OutOp(OP_PUT, inOp, err);
             }
 
             void CacheImpl::PutAll(ignite::impl::InputOperation& inOp, IgniteError* err)
             {
-                OutOpInternal(OP_PUT_ALL, inOp, err);
+                OutOp(OP_PUT_ALL, inOp, err);
             }
 
             void CacheImpl::GetAndPut(InputOperation& inOp, OutputOperation& outOp, IgniteError* err)
             {
-                OutInOpInternal(OP_GET_AND_PUT, inOp, outOp, err);
+                OutInOp(OP_GET_AND_PUT, inOp, outOp, err);
             }
 
             void CacheImpl::GetAndReplace(InputOperation& inOp, OutputOperation& outOp, IgniteError* err)
             {
-                OutInOpInternal(OP_GET_AND_REPLACE, inOp, outOp, err);
+                OutInOp(OP_GET_AND_REPLACE, inOp, outOp, err);
             }
 
             void CacheImpl::GetAndRemove(InputOperation& inOp, OutputOperation& outOp, IgniteError* err)
             {
-                OutInOpInternal(OP_GET_AND_REMOVE, inOp, outOp, err);
+                OutInOp(OP_GET_AND_REMOVE, inOp, outOp, err);
             }
 
             bool CacheImpl::PutIfAbsent(InputOperation& inOp, IgniteError* err)
             {
-                return OutOpInternal(OP_PUT_IF_ABSENT, inOp, err);
+                return OutOp(OP_PUT_IF_ABSENT, inOp, err);
             }
 
             void CacheImpl::GetAndPutIfAbsent(InputOperation& inOp, OutputOperation& outOp, IgniteError* err)
             {
-                OutInOpInternal(OP_GET_AND_PUT_IF_ABSENT, inOp, outOp, err);
+                OutInOp(OP_GET_AND_PUT_IF_ABSENT, inOp, outOp, err);
             }
 
             bool CacheImpl::Replace(InputOperation& inOp, IgniteError* err)
             {
-                return OutOpInternal(OP_REPLACE_2, inOp, err);
+                return OutOp(OP_REPLACE_2, inOp, err);
             }
 
             bool CacheImpl::ReplaceIfEqual(InputOperation& inOp, IgniteError* err)
             {
-                return OutOpInternal(OP_REPLACE_3, inOp, err);
+                return OutOp(OP_REPLACE_3, inOp, err);
             }
 
             void CacheImpl::LocalEvict(InputOperation& inOp, IgniteError* err)
             {
-                OutOpInternal(OP_LOCAL_EVICT, inOp, err);
+                OutOp(OP_LOCAL_EVICT, inOp, err);
             }
 
             void CacheImpl::Clear(IgniteError* err)
             {
                 JniErrorInfo jniErr;
 
-                env.Get()->Context()->CacheClear(javaRef, &jniErr);
+                GetEnvironment().Context()->CacheClear(GetTarget(), &jniErr);
 
                 IgniteError::SetError(jniErr.code, jniErr.errCls, jniErr.errMsg, err);
             }
 
             void CacheImpl::Clear(InputOperation& inOp, IgniteError* err)
             {
-                OutOpInternal(OP_CLEAR, inOp, err);
+                OutOp(OP_CLEAR, inOp, err);
             }
 
             void CacheImpl::ClearAll(InputOperation& inOp, IgniteError* err)
             {
-                OutOpInternal(OP_CLEAR_ALL, inOp, err);
+                OutOp(OP_CLEAR_ALL, inOp, err);
             }
 
             void CacheImpl::LocalClear(InputOperation& inOp, IgniteError* err)
             {
-                OutOpInternal(OP_LOCAL_CLEAR, inOp, err);
+                OutOp(OP_LOCAL_CLEAR, inOp, err);
             }
 
             void CacheImpl::LocalClearAll(InputOperation& inOp, IgniteError* err)
             {
-                OutOpInternal(OP_LOCAL_CLEAR_ALL, inOp, err);
+                OutOp(OP_LOCAL_CLEAR_ALL, inOp, err);
             }
 
             bool CacheImpl::Remove(InputOperation& inOp, IgniteError* err)
             {
-                return OutOpInternal(OP_REMOVE_1, inOp, err);
+                return OutOp(OP_REMOVE_1, inOp, err);
             }
 
             bool CacheImpl::RemoveIfEqual(InputOperation& inOp, IgniteError* err)
             {
-                return OutOpInternal(OP_REMOVE_2, inOp, err);
+                return OutOp(OP_REMOVE_2, inOp, err);
             }
 
             void CacheImpl::RemoveAll(InputOperation& inOp, IgniteError* err)
             {
-                OutOpInternal(OP_REMOVE_ALL, inOp, err);
+                OutOp(OP_REMOVE_ALL, inOp, err);
             }
 
             void CacheImpl::RemoveAll(IgniteError* err)
             {
                 JniErrorInfo jniErr;
 
-                env.Get()->Context()->CacheRemoveAll(javaRef, &jniErr);
+                GetEnvironment().Context()->CacheRemoveAll(GetTarget(), &jniErr);
 
                 IgniteError::SetError(jniErr.code, jniErr.errCls, jniErr.errMsg, err);
             }
@@ -301,44 +302,11 @@ namespace ignite
                 return QueryInternal(qry, OP_QRY_SQL_FIELDS, err);
             }
 
-            int64_t CacheImpl::WriteTo(InteropMemory* mem, InputOperation& inOp, IgniteError* err)
-            {
-                BinaryTypeManager* metaMgr = env.Get()->GetTypeManager();
-
-                int32_t metaVer = metaMgr->GetVersion();
-
-                InteropOutputStream out(mem);
-                BinaryWriterImpl writer(&out, metaMgr);
-                
-                inOp.ProcessInput(writer);
-
-                out.Synchronize();
-
-                if (metaMgr->IsUpdatedSince(metaVer))
-                {
-                    BinaryTypeUpdaterImpl metaUpdater(env, javaRef);
-
-                    if (!metaMgr->ProcessPendingUpdates(&metaUpdater, err))
-                        return 0;
-                }
-
-                return mem->PointerLong();
-            }
-
-            void CacheImpl::ReadFrom(InteropMemory* mem, OutputOperation& outOp)
-            {
-                InteropInputStream in(mem);
-
-                BinaryReaderImpl reader(&in);
-
-                outOp.ProcessOutput(reader);
-            }
-
             int CacheImpl::SizeInternal(const int32_t peekModes, const bool loc, IgniteError* err)
             {
                 JniErrorInfo jniErr;
 
-                int res = env.Get()->Context()->CacheSize(javaRef, peekModes, loc, &jniErr);
+                int res = GetEnvironment().Context()->CacheSize(GetTarget(), peekModes, loc, &jniErr);
 
                 IgniteError::SetError(jniErr.code, jniErr.errCls, jniErr.errMsg, err);
 
@@ -347,49 +315,6 @@ namespace ignite
                 else
                     return -1;
             }
-
-            bool CacheImpl::OutOpInternal(const int32_t opType, InputOperation& inOp, IgniteError* err)
-            {
-                JniErrorInfo jniErr;
-
-                SharedPointer<InteropMemory> mem = env.Get()->AllocateMemory();
-
-                int64_t outPtr = WriteTo(mem.Get(), inOp, err);
-
-                if (outPtr)
-                {
-                    long long res = env.Get()->Context()->TargetInStreamOutLong(javaRef, opType, outPtr, &jniErr);
-
-                    IgniteError::SetError(jniErr.code, jniErr.errCls, jniErr.errMsg, err);
-
-                    if (jniErr.code == IGNITE_JNI_ERR_SUCCESS)
-                        return res == 1;
-                }
-
-                return false;
-            }
-
-            void CacheImpl::OutInOpInternal(const int32_t opType, InputOperation& inOp, OutputOperation& outOp, 
-                IgniteError* err)
-            {
-                JniErrorInfo jniErr;
-
-                SharedPointer<InteropMemory> outMem = env.Get()->AllocateMemory();
-                SharedPointer<InteropMemory> inMem = env.Get()->AllocateMemory();
-
-                int64_t outPtr = WriteTo(outMem.Get(), inOp, err);
-
-                if (outPtr)
-                {
-                    env.Get()->Context()->TargetInStreamOutStream(javaRef, opType, outPtr,
-                        inMem.Get()->PointerLong(), &jniErr);
-
-                    IgniteError::SetError(jniErr.code, jniErr.errCls, jniErr.errMsg, err);
-
-                    if (jniErr.code == IGNITE_JNI_ERR_SUCCESS)
-                        ReadFrom(inMem.Get(), outOp);
-                }
-            }
         }
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/bc143c6a/modules/platforms/cpp/core/src/impl/ignite_impl.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core/src/impl/ignite_impl.cpp b/modules/platforms/cpp/core/src/impl/ignite_impl.cpp
index 72e06cf..0a10791 100644
--- a/modules/platforms/cpp/core/src/impl/ignite_impl.cpp
+++ b/modules/platforms/cpp/core/src/impl/ignite_impl.cpp
@@ -24,9 +24,15 @@ namespace ignite
 {    
     namespace impl
     {
-        IgniteImpl::IgniteImpl(SharedPointer<IgniteEnvironment> env, jobject javaRef) : env(env), javaRef(javaRef)
+        IgniteImpl::IgniteImpl(SharedPointer<IgniteEnvironment> env, jobject javaRef) :
+            env(env),
+            javaRef(javaRef)
         {
-            // No-op.
+            IgniteError err;
+
+            txImpl = InternalGetTransactions(err);
+
+            IgniteError::ThrowIfNeeded(err);
         }
 
         IgniteImpl::~IgniteImpl()
@@ -43,5 +49,21 @@ namespace ignite
         {
             return env.Get()->Context();
         }
-    }    
+
+        IgniteImpl::SP_TransactionsImpl IgniteImpl::InternalGetTransactions(IgniteError &err)
+        {
+            IgniteImpl::SP_TransactionsImpl res;
+
+            ignite::jni::java::JniErrorInfo jniErr;
+
+            jobject txJavaRef = env.Get()->Context()->ProcessorTransactions(javaRef, &jniErr);
+
+            if (txJavaRef)
+                res = SP_TransactionsImpl(new transactions::TransactionsImpl(env, txJavaRef));
+            else
+                IgniteError::SetError(jniErr.code, jniErr.errCls, jniErr.errMsg, &err);
+
+            return res;
+        }
+    }
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/bc143c6a/modules/platforms/cpp/core/src/impl/interop/interop_target.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core/src/impl/interop/interop_target.cpp b/modules/platforms/cpp/core/src/impl/interop/interop_target.cpp
new file mode 100644
index 0000000..05764c7
--- /dev/null
+++ b/modules/platforms/cpp/core/src/impl/interop/interop_target.cpp
@@ -0,0 +1,142 @@
+/*
+ * 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 "ignite/impl/interop/interop_target.h"
+#include "ignite/impl/binary/binary_type_updater_impl.h"
+
+using namespace ignite::common::concurrent;
+using namespace ignite::jni::java;
+using namespace ignite::java;
+using namespace ignite::impl::interop;
+using namespace ignite::impl::binary;
+using namespace ignite::binary;
+
+namespace ignite
+{
+    namespace impl
+    {
+        namespace interop
+        {
+            InteropTarget::InteropTarget(SharedPointer<IgniteEnvironment> env, jobject javaRef) :
+                env(env), javaRef(javaRef)
+            {
+                // No-op.
+            }
+
+            InteropTarget::~InteropTarget()
+            {
+                JniContext::Release(javaRef);
+            }
+
+            int64_t InteropTarget::WriteTo(InteropMemory* mem, InputOperation& inOp, IgniteError* err)
+            {
+                BinaryTypeManager* metaMgr = env.Get()->GetTypeManager();
+
+                int32_t metaVer = metaMgr->GetVersion();
+
+                InteropOutputStream out(mem);
+                BinaryWriterImpl writer(&out, metaMgr);
+                
+                inOp.ProcessInput(writer);
+
+                out.Synchronize();
+
+                if (metaMgr->IsUpdatedSince(metaVer))
+                {
+                    BinaryTypeUpdaterImpl metaUpdater(env, javaRef);
+
+                    if (!metaMgr->ProcessPendingUpdates(&metaUpdater, err))
+                        return 0;
+                }
+
+                return mem->PointerLong();
+            }
+
+            void InteropTarget::ReadFrom(InteropMemory* mem, OutputOperation& outOp)
+            {
+                InteropInputStream in(mem);
+
+                BinaryReaderImpl reader(&in);
+
+                outOp.ProcessOutput(reader);
+            }
+
+            bool InteropTarget::OutOp(int32_t opType, InputOperation& inOp, IgniteError* err)
+            {
+                JniErrorInfo jniErr;
+
+                SharedPointer<InteropMemory> mem = env.Get()->AllocateMemory();
+
+                int64_t outPtr = WriteTo(mem.Get(), inOp, err);
+
+                if (outPtr)
+                {
+                    long long res = env.Get()->Context()->TargetInStreamOutLong(javaRef, opType, outPtr, &jniErr);
+
+                    IgniteError::SetError(jniErr.code, jniErr.errCls, jniErr.errMsg, err);
+
+                    if (jniErr.code == IGNITE_JNI_ERR_SUCCESS)
+                        return res == 1;
+                }
+
+                return false;
+            }
+
+            bool InteropTarget::InOp(int32_t opType, OutputOperation& outOp, IgniteError* err)
+            {
+                JniErrorInfo jniErr;
+
+                SharedPointer<InteropMemory> mem = env.Get()->AllocateMemory();
+
+                env.Get()->Context()->TargetOutStream(javaRef, opType, mem.Get()->PointerLong(), &jniErr);
+
+                IgniteError::SetError(jniErr.code, jniErr.errCls, jniErr.errMsg, err);
+
+                if (jniErr.code == IGNITE_JNI_ERR_SUCCESS)
+                {
+                    ReadFrom(mem.Get(), outOp);
+
+                    return true;
+                }
+
+                return false;
+            }
+
+            void InteropTarget::OutInOp(int32_t opType, InputOperation& inOp, OutputOperation& outOp,
+                IgniteError* err)
+            {
+                JniErrorInfo jniErr;
+
+                SharedPointer<InteropMemory> outMem = env.Get()->AllocateMemory();
+                SharedPointer<InteropMemory> inMem = env.Get()->AllocateMemory();
+
+                int64_t outPtr = WriteTo(outMem.Get(), inOp, err);
+
+                if (outPtr)
+                {
+                    env.Get()->Context()->TargetInStreamOutStream(javaRef, opType, outPtr,
+                        inMem.Get()->PointerLong(), &jniErr);
+
+                    IgniteError::SetError(jniErr.code, jniErr.errCls, jniErr.errMsg, err);
+
+                    if (jniErr.code == IGNITE_JNI_ERR_SUCCESS)
+                        ReadFrom(inMem.Get(), outOp);
+                }
+            }
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/bc143c6a/modules/platforms/cpp/core/src/impl/transactions/transaction_impl.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core/src/impl/transactions/transaction_impl.cpp b/modules/platforms/cpp/core/src/impl/transactions/transaction_impl.cpp
new file mode 100644
index 0000000..63b3b6b
--- /dev/null
+++ b/modules/platforms/cpp/core/src/impl/transactions/transaction_impl.cpp
@@ -0,0 +1,196 @@
+/*
+ * 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 "ignite/impl/transactions/transactions_impl.h"
+#include "ignite/impl/transactions/transaction_impl.h"
+
+using namespace ignite::jni::java;
+using namespace ignite::transactions;
+
+namespace ignite 
+{
+    namespace impl
+    {
+        namespace transactions
+        {
+            TransactionImpl::TL_SP_TransactionsImpl TransactionImpl::threadTx;
+
+            TransactionImpl::TransactionImpl(SP_TransactionsImpl txs, int64_t id,
+                int concurrency, int isolation, int64_t timeout, int32_t txSize) :
+                txs(txs),
+                id(id),
+                concurrency(concurrency),
+                isolation(isolation),
+                timeout(timeout),
+                txSize(txSize),
+                state(IGNITE_TX_STATE_UNKNOWN),
+                closed(false)
+            {
+                // No-op.
+            }
+
+            TransactionImpl::SP_TransactionImpl TransactionImpl::Create(SP_TransactionsImpl txs,
+                int concurrency, int isolation, int64_t timeout, int32_t txSize, IgniteError& err)
+            {
+                int64_t id = txs.Get()->TxStart(concurrency, isolation, timeout, txSize, err);
+
+                SP_TransactionImpl tx;
+
+                if (err.GetCode() == IgniteError::IGNITE_SUCCESS)
+                {
+                    tx = SP_TransactionImpl(new TransactionImpl(txs, id, concurrency,
+                        isolation, timeout, txSize));
+
+                    threadTx.Set(tx);
+                }
+
+                return tx;
+            }
+
+            TransactionImpl::~TransactionImpl()
+            {
+                // No-op.
+            }
+
+            TransactionImpl::SP_TransactionImpl TransactionImpl::GetCurrent()
+            {
+                SP_TransactionImpl tx = threadTx.Get();
+                TransactionImpl* ptr = tx.Get();
+
+                if (ptr && ptr->IsClosed())
+                {
+                    tx = SP_TransactionImpl();
+
+                    threadTx.Remove();
+                }
+
+                return tx;
+            }
+
+            bool TransactionImpl::IsClosed() const
+            {
+                return closed;
+            }
+
+            void TransactionImpl::Commit(IgniteError& err)
+            {
+                common::concurrent::CsLockGuard guard(accessLock);
+
+                if (IsClosed())
+                {
+                    err = GetClosedError();
+
+                    return;
+                }
+
+                TransactionState newState = txs.Get()->TxCommit(id, err);
+
+                if (err.GetCode() == IgniteError::IGNITE_SUCCESS)
+                {
+                    state = newState;
+
+                    closed = true;
+                }
+            }
+
+            void TransactionImpl::Rollback(IgniteError & err)
+            {
+                common::concurrent::CsLockGuard guard(accessLock);
+
+                if (IsClosed())
+                {
+                    err = GetClosedError();
+
+                    return;
+                }
+
+                TransactionState newState = txs.Get()->TxRollback(id, err);
+
+                if (err.GetCode() == IgniteError::IGNITE_SUCCESS)
+                {
+                    state = newState;
+
+                    closed = true;
+                }
+            }
+
+            void TransactionImpl::Close(IgniteError & err)
+            {
+                common::concurrent::CsLockGuard guard(accessLock);
+
+                if (IsClosed())
+                {
+                    err = GetClosedError();
+
+                    return;
+                }
+
+                TransactionState newState = txs.Get()->TxClose(id, err);
+
+                if (err.GetCode() == IgniteError::IGNITE_SUCCESS)
+                {
+                    state = newState;
+
+                    closed = true;
+                }
+            }
+
+            void TransactionImpl::SetRollbackOnly(IgniteError & err)
+            {
+                common::concurrent::CsLockGuard guard(accessLock);
+
+                if (IsClosed())
+                {
+                    err = GetClosedError();
+
+                    return;
+                }
+
+                txs.Get()->TxSetRollbackOnly(id, err);
+            }
+
+            bool TransactionImpl::IsRollbackOnly(IgniteError& err)
+            {
+                TransactionState state0 = GetState(err);
+
+                return state0 == IGNITE_TX_STATE_MARKED_ROLLBACK ||
+                       state0 == IGNITE_TX_STATE_ROLLING_BACK ||
+                       state0 == IGNITE_TX_STATE_ROLLED_BACK;
+            }
+
+            TransactionState TransactionImpl::GetState(IgniteError& err)
+            {
+                common::concurrent::CsLockGuard guard(accessLock);
+
+                if (closed)
+                    return state;
+
+                return txs.Get()->TxState(id, err);
+            }
+
+            IgniteError TransactionImpl::GetClosedError() const
+            {
+                std::stringstream buf;
+
+                buf << "Transaction " << id << " is closed. State: " << state;
+
+                return IgniteError(IgniteError::IGNITE_ERR_ILLEGAL_STATE, buf.str().c_str());
+            }
+        }
+    }
+}
+

http://git-wip-us.apache.org/repos/asf/ignite/blob/bc143c6a/modules/platforms/cpp/core/src/impl/transactions/transactions_impl.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core/src/impl/transactions/transactions_impl.cpp b/modules/platforms/cpp/core/src/impl/transactions/transactions_impl.cpp
new file mode 100644
index 0000000..6c01332
--- /dev/null
+++ b/modules/platforms/cpp/core/src/impl/transactions/transactions_impl.cpp
@@ -0,0 +1,200 @@
+/*
+ * 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 "ignite/impl/transactions/transactions_impl.h"
+
+using namespace ignite::jni::java;
+using namespace ignite::java;
+using namespace ignite::transactions;
+
+namespace ignite 
+{
+    namespace impl
+    {
+        namespace transactions
+        {
+            /**
+             * Transaction opertion.
+             */
+            enum Operation
+            {
+                /** Get metrics operation. */
+                OP_METRICS = 2
+            };
+
+            TransactionsImpl::TransactionsImpl(SP_IgniteEnvironment env, jobject javaRef) :
+                InteropTarget(env, javaRef)
+            {
+                // No-op.
+            }
+
+            TransactionsImpl::~TransactionsImpl()
+            {
+                // No-op.
+            }
+
+            int64_t TransactionsImpl::TxStart(int concurrency, int isolation,
+                int64_t timeout, int32_t txSize, IgniteError& err)
+            {
+                JniErrorInfo jniErr;
+
+                int64_t id = GetEnvironment().Context()->TransactionsStart(GetTarget(),
+                    concurrency, isolation, timeout, txSize, &jniErr);
+
+                if (jniErr.code != IGNITE_JNI_ERR_SUCCESS)
+                    IgniteError::SetError(jniErr.code, jniErr.errCls, jniErr.errMsg, &err);
+
+                return id;
+            }
+
+            TransactionsImpl::TransactionState TransactionsImpl::TxCommit(int64_t id, IgniteError& err)
+            {
+                JniErrorInfo jniErr;
+
+                int state = GetEnvironment().Context()->TransactionsCommit(GetTarget(), id, &jniErr);
+
+                if (jniErr.code != IGNITE_JNI_ERR_SUCCESS)
+                    IgniteError::SetError(jniErr.code, jniErr.errCls, jniErr.errMsg, &err);
+
+                return ToTransactionState(state);
+            }
+
+            TransactionsImpl::TransactionState TransactionsImpl::TxRollback(int64_t id, IgniteError& err)
+            {
+                JniErrorInfo jniErr;
+
+                int state = GetEnvironment().Context()->TransactionsRollback(GetTarget(), id, &jniErr);
+
+                if (jniErr.code != IGNITE_JNI_ERR_SUCCESS)
+                    IgniteError::SetError(jniErr.code, jniErr.errCls, jniErr.errMsg, &err);
+
+                return ToTransactionState(state);
+            }
+
+            TransactionsImpl::TransactionState TransactionsImpl::TxClose(int64_t id, IgniteError& err)
+            {
+                JniErrorInfo jniErr;
+
+                int state = GetEnvironment().Context()->TransactionsClose(GetTarget(), id, &jniErr);
+
+                if (jniErr.code != IGNITE_JNI_ERR_SUCCESS)
+                    IgniteError::SetError(jniErr.code, jniErr.errCls, jniErr.errMsg, &err);
+
+                return ToTransactionState(state);
+            }
+
+            bool TransactionsImpl::TxSetRollbackOnly(int64_t id, IgniteError& err)
+            {
+                JniErrorInfo jniErr;
+
+                bool rollbackOnly = GetEnvironment().Context()->TransactionsSetRollbackOnly(GetTarget(), id, &jniErr);
+
+                if (jniErr.code != IGNITE_JNI_ERR_SUCCESS)
+                    IgniteError::SetError(jniErr.code, jniErr.errCls, jniErr.errMsg, &err);
+
+                return rollbackOnly;
+            }
+
+            TransactionsImpl::TransactionState TransactionsImpl::TxState(int64_t id, IgniteError& err)
+            {
+                JniErrorInfo jniErr;
+
+                int state = GetEnvironment().Context()->TransactionsState(GetTarget(), id, &jniErr);
+
+                if (jniErr.code != IGNITE_JNI_ERR_SUCCESS)
+                    IgniteError::SetError(jniErr.code, jniErr.errCls, jniErr.errMsg, &err);
+
+                return ToTransactionState(state);
+            }
+
+            /**
+             * Output operation for Metrics.
+             */
+            class OutTransactionMetricsOperation : public OutputOperation
+            {
+            public:
+                /**
+                 * Constructor.
+                 */
+                OutTransactionMetricsOperation()
+                {
+                    // No-op.
+                }
+
+                virtual void ProcessOutput(ignite::impl::binary::BinaryReaderImpl& reader)
+                {
+                    Timestamp commitTime = reader.ReadTopObject<Timestamp>();
+                    Timestamp rollbackTime = reader.ReadTopObject<Timestamp>();
+                    int32_t commits = reader.ReadInt32();
+                    int32_t rollbacks = reader.ReadInt32();
+
+                    val = TransactionMetrics(commitTime, rollbackTime, commits, rollbacks);
+                }
+
+                /**
+                 * Get value.
+                 *
+                 * @return Value.
+                 */
+                TransactionMetrics& Get()
+                {
+                    return val;
+                }
+
+            private:
+                /** Value */
+                TransactionMetrics val;
+
+                IGNITE_NO_COPY_ASSIGNMENT(OutTransactionMetricsOperation)
+            };
+
+            TransactionMetrics TransactionsImpl::GetMetrics(IgniteError& err)
+            {
+                OutTransactionMetricsOperation op;
+
+                InOp(OP_METRICS, op, &err);
+
+                if (err.GetCode() == IgniteError::IGNITE_SUCCESS)
+                    return op.Get();
+
+                return ignite::transactions::TransactionMetrics();
+            }
+
+            TransactionsImpl::TransactionState TransactionsImpl::ToTransactionState(int state)
+            {
+                using namespace ignite::transactions;
+                switch (state)
+                {
+                    case IGNITE_TX_STATE_ACTIVE:
+                    case IGNITE_TX_STATE_PREPARING:
+                    case IGNITE_TX_STATE_PREPARED:
+                    case IGNITE_TX_STATE_MARKED_ROLLBACK:
+                    case IGNITE_TX_STATE_COMMITTING:
+                    case IGNITE_TX_STATE_COMMITTED:
+                    case IGNITE_TX_STATE_ROLLING_BACK:
+                    case IGNITE_TX_STATE_ROLLED_BACK:
+                    case IGNITE_TX_STATE_UNKNOWN:
+                        return static_cast<TransactionState>(state);
+
+                    default:
+                        return IGNITE_TX_STATE_UNKNOWN;
+                }
+            }
+        }
+    }
+}
+

http://git-wip-us.apache.org/repos/asf/ignite/blob/bc143c6a/modules/platforms/cpp/core/src/transactions/transaction.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core/src/transactions/transaction.cpp b/modules/platforms/cpp/core/src/transactions/transaction.cpp
new file mode 100644
index 0000000..59e2d4a
--- /dev/null
+++ b/modules/platforms/cpp/core/src/transactions/transaction.cpp
@@ -0,0 +1,204 @@
+/*
+ * 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 "ignite/transactions/transaction.h"
+
+using namespace ignite::common::concurrent;
+using namespace ignite::impl::transactions;
+
+namespace ignite
+{
+    namespace transactions
+    {
+        Transaction::Transaction(SharedPointer<TransactionImpl> impl) :
+            impl(impl)
+        {
+            // No-op.
+        }
+
+        Transaction::Transaction(const Transaction & other) :
+            impl(other.impl)
+        {
+            // No-op.
+        }
+
+        Transaction& Transaction::operator=(const Transaction& other)
+        {
+            impl = other.impl;
+
+            return *this;
+        }
+
+        Transaction::~Transaction()
+        {
+            // No-op.
+        }
+
+        void Transaction::Commit()
+        {
+            IgniteError err;
+
+            Commit(err);
+
+            IgniteError::ThrowIfNeeded(err);
+        }
+
+        void Transaction::Commit(IgniteError & err)
+        {
+            err = IgniteError();
+
+            TransactionImpl* txImpl = impl.Get();
+
+            if (txImpl)
+                txImpl->Commit(err);
+            else
+            {
+                err = IgniteError(IgniteError::IGNITE_ERR_GENERIC,
+                    "Instance is not usable (did you check for error?).");
+            }
+        }
+
+        void Transaction::Rollback()
+        {
+            IgniteError err;
+
+            Rollback(err);
+
+            IgniteError::ThrowIfNeeded(err);
+        }
+
+        void Transaction::Rollback(IgniteError & err)
+        {
+            err = IgniteError();
+
+            TransactionImpl* txImpl = impl.Get();
+
+            if (txImpl)
+                txImpl->Rollback(err);
+            else
+            {
+                err = IgniteError(IgniteError::IGNITE_ERR_GENERIC,
+                    "Instance is not usable (did you check for error?).");
+            }
+        }
+
+        void Transaction::Close()
+        {
+            IgniteError err;
+
+            Close(err);
+
+            IgniteError::ThrowIfNeeded(err);
+        }
+
+        void Transaction::Close(IgniteError & err)
+        {
+            err = IgniteError();
+
+            TransactionImpl* txImpl = impl.Get();
+
+            if (txImpl)
+                txImpl->Close(err);
+            else
+            {
+                err = IgniteError(IgniteError::IGNITE_ERR_GENERIC,
+                    "Instance is not usable (did you check for error?).");
+            }
+        }
+
+        void Transaction::SetRollbackOnly()
+        {
+            IgniteError err;
+
+            SetRollbackOnly(err);
+
+            IgniteError::ThrowIfNeeded(err);
+        }
+
+        void Transaction::SetRollbackOnly(IgniteError & err)
+        {
+            err = IgniteError();
+
+            TransactionImpl* txImpl = impl.Get();
+
+            if (txImpl)
+                txImpl->SetRollbackOnly(err);
+            else
+            {
+                err = IgniteError(IgniteError::IGNITE_ERR_GENERIC,
+                    "Instance is not usable (did you check for error?).");
+            }
+        }
+
+        bool Transaction::IsRollbackOnly()
+        {
+            IgniteError err;
+
+            bool res = IsRollbackOnly(err);
+
+            IgniteError::ThrowIfNeeded(err);
+
+            return res;
+        }
+
+        bool Transaction::IsRollbackOnly(IgniteError& err)
+        {
+            err = IgniteError();
+
+            TransactionImpl* txImpl = impl.Get();
+
+            if (txImpl)
+                return txImpl->IsRollbackOnly(err);
+            else
+            {
+                err = IgniteError(IgniteError::IGNITE_ERR_GENERIC,
+                    "Instance is not usable (did you check for error?).");
+            }
+
+            return false;
+        }
+
+        TransactionState Transaction::GetState()
+        {
+            IgniteError err;
+
+            TransactionState res = GetState(err);
+
+            IgniteError::ThrowIfNeeded(err);
+
+            return res;
+        }
+
+        TransactionState Transaction::GetState(IgniteError& err)
+        {
+            err = IgniteError();
+
+            TransactionImpl* txImpl = impl.Get();
+
+            if (txImpl)
+                return txImpl->GetState(err);
+            else
+            {
+                err = IgniteError(IgniteError::IGNITE_ERR_GENERIC,
+                    "Instance is not usable (did you check for error?).");
+            }
+
+            return IGNITE_TX_STATE_UNKNOWN;
+        }
+    }
+}
+

http://git-wip-us.apache.org/repos/asf/ignite/blob/bc143c6a/modules/platforms/cpp/core/src/transactions/transactions.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core/src/transactions/transactions.cpp b/modules/platforms/cpp/core/src/transactions/transactions.cpp
new file mode 100644
index 0000000..081f97a
--- /dev/null
+++ b/modules/platforms/cpp/core/src/transactions/transactions.cpp
@@ -0,0 +1,142 @@
+/*
+ * 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 "ignite/transactions/transactions.h"
+
+using namespace ignite::common::concurrent;
+using namespace ignite::impl::transactions;
+
+namespace ignite
+{
+    namespace transactions
+    {
+        Transactions::Transactions(SharedPointer<TransactionsImpl> impl) :
+            impl(impl)
+        {
+            // No-op.
+        }
+
+        Transactions::Transactions(const Transactions & other) :
+            impl(other.impl)
+        {
+            // No-op.
+        }
+
+        Transactions& Transactions::operator=(const Transactions& other)
+        {
+            impl = other.impl;
+
+            return *this;
+        }
+
+        Transactions::~Transactions()
+        {
+            // No-op.
+        }
+
+        Transaction Transactions::GetTx()
+        {
+            return Transaction(TransactionImpl::GetCurrent());
+        }
+
+        Transaction Transactions::TxStart()
+        {
+            IgniteError err;
+
+            Transaction tx = TxStart(err);
+
+            IgniteError::ThrowIfNeeded(err);
+
+            return tx;
+        }
+
+        Transaction Transactions::TxStart(IgniteError& err)
+        {
+            return TxStart(IGNITE_TX_CONCURRENCY_PESSIMISTIC,
+                IGNITE_TX_ISOLATION_READ_COMMITTED, 0, 0, err);
+        }
+
+        Transaction Transactions::TxStart(TransactionConcurrency concurrency,
+            TransactionIsolation isolation)
+        {
+            IgniteError err;
+
+            Transaction tx = TxStart(concurrency, isolation, err);
+
+            IgniteError::ThrowIfNeeded(err);
+
+            return tx;
+        }
+
+        Transaction Transactions::TxStart(TransactionConcurrency concurrency,
+            TransactionIsolation isolation, IgniteError& err)
+        {
+            return TxStart(concurrency, isolation, 0, 0, err);
+        }
+
+        Transaction Transactions::TxStart(TransactionConcurrency concurrency,
+            TransactionIsolation isolation, int64_t timeout, int32_t txSize)
+        {
+            IgniteError err;
+
+            Transaction tx = TxStart(concurrency,
+                isolation, timeout, txSize, err);
+
+            IgniteError::ThrowIfNeeded(err);
+
+            return tx;
+        }
+
+        Transaction Transactions::TxStart(TransactionConcurrency concurrency,
+            TransactionIsolation isolation, int64_t timeout, int32_t txSize,
+            IgniteError& err)
+        {
+            err = IgniteError();
+
+            SharedPointer<TransactionImpl> tx = TransactionImpl::Create(impl,
+                concurrency, isolation, timeout, txSize, err);
+
+            return Transaction(tx);
+        }
+
+        TransactionMetrics Transactions::GetMetrics()
+        {
+            IgniteError err;
+
+            TransactionMetrics metrics = GetMetrics(err);
+
+            IgniteError::ThrowIfNeeded(err);
+
+            return metrics;
+        }
+
+        TransactionMetrics Transactions::GetMetrics(IgniteError& err)
+        {
+            TransactionsImpl* txImpl = impl.Get();
+
+            if (txImpl)
+                return txImpl->GetMetrics(err);
+            else
+            {
+                err = IgniteError(IgniteError::IGNITE_ERR_GENERIC,
+                    "Instance is not usable (did you check for error?).");
+            }
+
+            return TransactionMetrics();
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/bc143c6a/modules/platforms/cpp/jni/include/ignite/jni/java.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/jni/include/ignite/jni/java.h b/modules/platforms/cpp/jni/include/ignite/jni/java.h
index 5ffbb8a..8be8a32 100644
--- a/modules/platforms/cpp/jni/include/ignite/jni/java.h
+++ b/modules/platforms/cpp/jni/include/ignite/jni/java.h
@@ -523,7 +523,7 @@ namespace ignite
                 void ProcessorDestroyCache(jobject obj, const char* name, JniErrorInfo* errInfo);
                 jobject ProcessorAffinity(jobject obj, const char* name);
                 jobject ProcessorDataStreamer(jobject obj, const char* name, bool keepPortable);
-                jobject ProcessorTransactions(jobject obj);
+                jobject ProcessorTransactions(jobject obj, JniErrorInfo* errInfo = NULL);
                 jobject ProcessorCompute(jobject obj, jobject prj);
                 jobject ProcessorMessage(jobject obj, jobject prj);
                 jobject ProcessorEvents(jobject obj, jobject prj);
@@ -601,14 +601,14 @@ namespace ignite
                 bool QueryCursorIteratorHasNext(jobject obj, JniErrorInfo* errInfo = NULL);
                 void QueryCursorClose(jobject obj, JniErrorInfo* errInfo = NULL);
 
-                long long TransactionsStart(jobject obj, int concurrency, int isolation, long long timeout, int txSize);
-                int TransactionsCommit(jobject obj, long long id);
+                long long TransactionsStart(jobject obj, int concurrency, int isolation, long long timeout, int txSize, JniErrorInfo* errInfo = NULL);
+                int TransactionsCommit(jobject obj, long long id, JniErrorInfo* errInfo = NULL);
                 void TransactionsCommitAsync(jobject obj, long long id, long long futId);
-                int TransactionsRollback(jobject obj, long long id);
+                int TransactionsRollback(jobject obj, long long id, JniErrorInfo* errInfo = NULL);
                 void TransactionsRollbackAsync(jobject obj, long long id, long long futId);
-                int TransactionsClose(jobject obj, long long id);
-                int TransactionsState(jobject obj, long long id);
-                bool TransactionsSetRollbackOnly(jobject obj, long long id);
+                int TransactionsClose(jobject obj, long long id, JniErrorInfo* errInfo = NULL);
+                int TransactionsState(jobject obj, long long id, JniErrorInfo* errInfo = NULL);
+                bool TransactionsSetRollbackOnly(jobject obj, long long id, JniErrorInfo* errInfo = NULL);
                 void TransactionsResetMetrics(jobject obj);
 
                 jobject EventsWithAsync(jobject obj);

http://git-wip-us.apache.org/repos/asf/ignite/blob/bc143c6a/modules/platforms/cpp/jni/src/java.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/jni/src/java.cpp b/modules/platforms/cpp/jni/src/java.cpp
index 95fa9cb..282b874 100644
--- a/modules/platforms/cpp/jni/src/java.cpp
+++ b/modules/platforms/cpp/jni/src/java.cpp
@@ -992,7 +992,7 @@ namespace ignite
                         {
                             GetJniErrorMessage(errMsg, res);
 
-                            errMsgLen = errMsg.length();
+                            errMsgLen = static_cast<int>(errMsg.length());
                         }
                     }
 
@@ -1349,12 +1349,12 @@ namespace ignite
                 return LocalToGlobal(env, ldr);
             }
 
-            jobject JniContext::ProcessorTransactions(jobject obj) {
+            jobject JniContext::ProcessorTransactions(jobject obj, JniErrorInfo* errInfo) {
                 JNIEnv* env = Attach();
 
                 jobject tx = env->CallObjectMethod(obj, jvm->GetMembers().m_PlatformProcessor_transactions);
 
-                ExceptionCheck(env);
+                ExceptionCheck(env, errInfo);
 
                 return LocalToGlobal(env, tx);
             }
@@ -2002,22 +2002,25 @@ namespace ignite
                 ExceptionCheck(env, errInfo);
             }
 
-            long long JniContext::TransactionsStart(jobject obj, int concurrency, int isolation, long long timeout, int txSize) {
+            long long JniContext::TransactionsStart(jobject obj, int concurrency,
+                int isolation, long long timeout, int txSize, JniErrorInfo* errInfo) {
                 JNIEnv* env = Attach();
 
-                long long id = env->CallLongMethod(obj, jvm->GetMembers().m_PlatformTransactions_txStart, concurrency, isolation, timeout, txSize);
+                long long id = env->CallLongMethod(obj,
+                    jvm->GetMembers().m_PlatformTransactions_txStart,
+                    concurrency, isolation, timeout, txSize);
 
-                ExceptionCheck(env);
+                ExceptionCheck(env, errInfo);
 
                 return id;
             }
 
-            int JniContext::TransactionsCommit(jobject obj, long long id) {
+            int JniContext::TransactionsCommit(jobject obj, long long id, JniErrorInfo* errInfo) {
                 JNIEnv* env = Attach();
 
                 int res = env->CallIntMethod(obj, jvm->GetMembers().m_PlatformTransactions_txCommit, id);
 
-                ExceptionCheck(env);
+                ExceptionCheck(env, errInfo);
 
                 return res;
             }
@@ -2030,12 +2033,12 @@ namespace ignite
                 ExceptionCheck(env);
             }
 
-            int JniContext::TransactionsRollback(jobject obj, long long id) {
+            int JniContext::TransactionsRollback(jobject obj, long long id, JniErrorInfo* errInfo) {
                 JNIEnv* env = Attach();
 
                 int res = env->CallIntMethod(obj, jvm->GetMembers().m_PlatformTransactions_txRollback, id);
 
-                ExceptionCheck(env);
+                ExceptionCheck(env, errInfo);
 
                 return res;
             }
@@ -2048,32 +2051,32 @@ namespace ignite
                 ExceptionCheck(env);
             }
 
-            int JniContext::TransactionsClose(jobject obj, long long id) {
+            int JniContext::TransactionsClose(jobject obj, long long id, JniErrorInfo* errInfo) {
                 JNIEnv* env = Attach();
 
                 jint state = env->CallIntMethod(obj, jvm->GetMembers().m_PlatformTransactions_txClose, id);
 
-                ExceptionCheck(env);
+                ExceptionCheck(env, errInfo);
 
                 return state;
             }
 
-            int JniContext::TransactionsState(jobject obj, long long id) {
+            int JniContext::TransactionsState(jobject obj, long long id, JniErrorInfo* errInfo) {
                 JNIEnv* env = Attach();
 
                 jint state = env->CallIntMethod(obj, jvm->GetMembers().m_PlatformTransactions_txState, id);
 
-                ExceptionCheck(env);
+                ExceptionCheck(env, errInfo);
 
                 return state;
             }
 
-            bool JniContext::TransactionsSetRollbackOnly(jobject obj, long long id) {
+            bool JniContext::TransactionsSetRollbackOnly(jobject obj, long long id, JniErrorInfo* errInfo) {
                 JNIEnv* env = Attach();
 
                 jboolean res = env->CallBooleanMethod(obj, jvm->GetMembers().m_PlatformTransactions_txSetRollbackOnly, id);
 
-                ExceptionCheck(env);
+                ExceptionCheck(env, errInfo);
 
                 return res != 0;
             }

http://git-wip-us.apache.org/repos/asf/ignite/blob/bc143c6a/modules/platforms/cpp/odbc/include/ignite/odbc/column.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/include/ignite/odbc/column.h b/modules/platforms/cpp/odbc/include/ignite/odbc/column.h
index cd48a40..1297279 100644
--- a/modules/platforms/cpp/odbc/include/ignite/odbc/column.h
+++ b/modules/platforms/cpp/odbc/include/ignite/odbc/column.h
@@ -88,6 +88,12 @@ namespace ignite
             /**
              * Check if the column is in valid state.
              *
+             * Invalid instance can be returned if some of the previous
+             * operations have resulted in a failure. For example invalid
+             * instance can be returned by not-throwing version of method
+             * in case of error. Invalid instances also often can be
+             * created using default constructor.
+             *
              * @return True if valid.
              */
             bool IsValid() const

http://git-wip-us.apache.org/repos/asf/ignite/blob/bc143c6a/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 1171c54..ca5587d 100644
--- a/modules/platforms/cpp/odbc/project/vs/odbc.vcxproj
+++ b/modules/platforms/cpp/odbc/project/vs/odbc.vcxproj
@@ -223,7 +223,6 @@
     <ClInclude Include="..\..\include\ignite\odbc\system\socket_client.h" />
     <ClInclude Include="..\..\include\ignite\odbc\type_traits.h" />
     <ClInclude Include="..\..\include\ignite\odbc\utility.h" />
-    <ClInclude Include="result_page.h" />
   </ItemGroup>
   <ItemGroup>
     <ProjectReference Include="..\..\..\binary\project\vs\binary.vcxproj">

http://git-wip-us.apache.org/repos/asf/ignite/blob/bc143c6a/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 901c93b..804fc2d 100644
--- a/modules/platforms/cpp/odbc/project/vs/odbc.vcxproj.filters
+++ b/modules/platforms/cpp/odbc/project/vs/odbc.vcxproj.filters
@@ -125,7 +125,6 @@
     </None>
   </ItemGroup>
   <ItemGroup>
-    <ClInclude Include="result_page.h" />
     <ClInclude Include="..\..\include\ignite\odbc\common_types.h">
       <Filter>Code</Filter>
     </ClInclude>


Mime
View raw message