| Apache Ignite C++

thin-client/include/ignite/thin/transactions/transaction.h
1 /*
2 * Licensed to the Apache Software Foundation (ASF) under one or more
3 * contributor license agreements. See the NOTICE file distributed with
4 * this work for additional information regarding copyright ownership.
5 * The ASF licenses this file to You under the Apache License, Version 2.0
6 * (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18 #ifndef _IGNITE_THIN_TRANSACTIONS_CLIENT_TRANSACTION
19 #define _IGNITE_THIN_TRANSACTIONS_CLIENT_TRANSACTION
20
21 #include <ignite/impl/thin/transactions/transactions_proxy.h>
22
23 namespace ignite
24 {
25 namespace thin
26 {
27 namespace transactions
28 {
38 class ClientTransaction {
39
40 public:
46 ClientTransaction(ignite::impl::thin::transactions::TransactionProxy impl) :
47 proxy(impl)
48 {
49 // No-op.
50 }
51
55 ClientTransaction()
56 {
57 // No-op.
58 }
59
63 ~ClientTransaction()
64 {
65 // No-op.
66 }
67
71 void Commit()
72 {
73 proxy.commit();
74 }
75
79 void Rollback()
80 {
81 proxy.rollback();
82 }
83
87 void Close()
88 {
89 proxy.close();
90 }
91
92 private:
94 ignite::impl::thin::transactions::TransactionProxy proxy;
95 };
96 }
97 }
98 }
99
100 #endif // _IGNITE_THIN_TRANSACTIONS_CLIENT_TRANSACTION
ignite
Apache Ignite API.
Definition: cache.h:48
ignite::thin::transactions::ClientTransaction::ClientTransaction
ClientTransaction()
Default constructor.
Definition: thin-client/include/ignite/thin/transactions/transaction.h:55
ignite::thin::transactions::ClientTransaction::Close
void Close()
Ends the transaction.
Definition: thin-client/include/ignite/thin/transactions/transaction.h:87
ignite::thin::transactions::ClientTransaction::~ClientTransaction
~ClientTransaction()
Destructor.
Definition: thin-client/include/ignite/thin/transactions/transaction.h:63
ignite::thin::transactions::ClientTransaction::ClientTransaction
ClientTransaction(ignite::impl::thin::transactions::TransactionProxy impl)
Constructor.
Definition: thin-client/include/ignite/thin/transactions/transaction.h:46
ignite::thin::transactions::ClientTransaction::Rollback
void Rollback()
Rolls back this transaction.
Definition: thin-client/include/ignite/thin/transactions/transaction.h:79
ignite::thin::transactions::ClientTransaction::Commit
void Commit()
Commits this transaction.
Definition: thin-client/include/ignite/thin/transactions/transaction.h:71
ignite::thin::transactions::ClientTransaction
Transaction client.
Definition: thin-client/include/ignite/thin/transactions/transaction.h:38