MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
NDBT_DataSetTransaction.hpp
1 /*
2  Copyright (C) 2003, 2005, 2006 MySQL AB
3  All rights reserved. Use is subject to license terms.
4 
5  This program is free software; you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation; version 2 of the License.
8 
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License
15  along with this program; if not, write to the Free Software
16  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18 
19 #ifndef NDBT_DATA_SET_TRANSACTION_HPP
20 #define NDBT_DATA_SET_TRANSACTION_HPP
21 
22 #include "NDBT_Table.hpp"
23 #include <NdbApi.hpp>
24 
25 class NDBT_DataSet;
26 
33 public:
37  static void insert(Ndb * theNdbObject,
38  const NDBT_DataSet *,
39  bool rollback = false);
40 
44  static void readByPk(Ndb * theNdbObject,
45  NDBT_DataSet *,
46  bool rollback = false);
47 
52  static void updateByPk(Ndb * theNdbObject,
53  const NDBT_DataSet *,
54  bool rollback = false);
55 
59  static void deleteByPk(Ndb * theNdbObject,
60  const NDBT_DataSet *,
61  bool rollback = false);
62 };
63 
65 public:
66  enum OperationType {
67  OT_Insert,
68  OT_ReadByPk,
69  OT_UpdateByPk,
70  OT_DeleteByPk
71  };
72 
82  typedef (* NDBT_DataSetAsyncTransactionCallback)(OperationType,
83  const NDBT_DataSet *,
84  bool commit,
85  void * anyObject);
89  static void insert(Ndb * theNdbObject,
90  const NDBT_DataSet *,
91  bool rollback = false,
93  void * anyObject);
94 
98  static void readByPk(Ndb * theNdbObject,
99  NDBT_DataSet *,
100  bool rollback = false,
102  void * anyObject);
103 
104 
109  static void updateByPk(Ndb * theNdbObject,
110  const NDBT_DataSet *,
111  bool rollback = false,
113  void * anyObject);
114 
115 
119  static void deleteByPk(Ndb * theNdbObject,
120  const NDBT_DataSet *,
121  bool rollback = false,
123  void * anyObject);
124 
125 };
126 
128 public:
132  static void insert(Ndb * theNdbObject,
133  const NDBT_DataSet *,
134  int parallellTransactions = 1,
135  int operationsPerTransaction = 10);
136 
140  static void readByPk(Ndb * theNdbObject,
141  NDBT_DataSet *,
142  int parallellTransactions = 1,
143  int operationsPerTransaction = 10);
144 
149  static void updateByPk(Ndb * theNdbObject,
150  const NDBT_DataSet *,
151  int parallellTransactions = 1,
152  int operationsPerTransaction = 10);
153 
157  static void deleteByPk(Ndb * theNdbObject,
158  const NDBT_DataSet *,
159  int parallellTransactions = 1,
160  int operationsPerTransaction = 10);
161 };
162 
163 
164 #endif