XTA: API Reference for C++ language

Transaction.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2009-2018, Christian Ferrari <tiian@users.sourceforge.net>
3  * All rights reserved.
4  *
5  * This file is part of LIXA.
6  *
7  * LIXA is free software: you can redistribute this file and/or modify
8  * it under the terms of the GNU Lesser General Public License version 2.1 as
9  * published by the Free Software Foundation.
10  *
11  * LIXA is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public License
17  * along with LIXA. If not, see <http://www.gnu.org/licenses/>.
18  */
19 #ifndef TRANSACTION_HPP
20 # define TRANSACTION_HPP
21 
22 
23 
24 /* include C++ standard header files */
25 #include <string>
26 
27 /* include XTA header file */
28 #include "xta.h"
29 #include "Config.hpp"
30 #include "Xid.hpp"
31 #include "XaResource.hpp"
32 
33 
34 
35 using namespace std;
36 
37 
38 
39 namespace xta {
43  class Transaction {
44  public:
50  Transaction(xta_transaction_t *tx);
56  ~Transaction();
62  void enlistResource(XaResource *xaRes);
74  void start(bool MultipleBranches=false);
82  void commit(bool NonBlocking=false);
86  void rollback(void);
94  void suspend(long Flags=TMMIGRATE);
105  void resume(const string& XidString, long Flags=TMRESUME);
112  void recover(void);
120  void branch(const string& XidString);
121 
128  Xid getXid();
129 
133  Config &getConfig();
134  private:
138  xta_transaction_t *tx;
145  };
146 };
147 
148 
149 
150 #endif /* TRANSACTION_HPP */
xta_transaction_t * tx
Definition: Xid.hpp:25
#define TMMIGRATE
Definition: xa.h:205
#define TMRESUME
Definition: xa.h:177

Copyright © 2009-2019, Christian Ferrari tiian@users.sourceforge.net http://www.tiian.org/