1
/* Copyright (C) 2003 MySQL AB
3
This program is free software; you can redistribute it and/or modify
4
it under the terms of the GNU General Public License as published by
5
the Free Software Foundation; version 2 of the License.
7
This program is distributed in the hope that it will be useful,
8
but WITHOUT ANY WARRANTY; without even the implied warranty of
9
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10
GNU General Public License for more details.
12
You should have received a copy of the GNU General Public License
13
along with this program; if not, write to the Free Software
14
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
16
#ifndef NDBT_DATA_SET_TRANSACTION_HPP
17
#define NDBT_DATA_SET_TRANSACTION_HPP
19
#include "NDBT_Table.hpp"
25
* This class contains a bunch a methods
26
* that operates on NDB together with a NDBT_DataSet
27
* using <b>one</b> transaction
29
class NDBT_DataSetTransaction {
32
* Store the data into ndb
34
static void insert(Ndb * theNdbObject,
36
bool rollback = false);
39
* Read data (using pk) from ndb
41
static void readByPk(Ndb * theNdbObject,
43
bool rollback = false);
46
* Update data using pk
49
static void updateByPk(Ndb * theNdbObject,
51
bool rollback = false);
56
static void deleteByPk(Ndb * theNdbObject,
58
bool rollback = false);
61
class NDBT_DataSetAsyncTransaction {
71
* A callback for the NDBT_DataSetAsyncTransaction
74
* The callback method returns:
75
* - the operation performed
77
* - if the transaction was commited or aborted
79
typedef (* NDBT_DataSetAsyncTransactionCallback)(OperationType,
84
* Store the data into ndb
86
static void insert(Ndb * theNdbObject,
88
bool rollback = false,
89
NDBT_DataSetAsyncTransactionCallback fun,
93
* Read data (using pk) from ndb
95
static void readByPk(Ndb * theNdbObject,
97
bool rollback = false,
98
NDBT_DataSetAsyncTransactionCallback fun,
103
* Update data using pk
106
static void updateByPk(Ndb * theNdbObject,
107
const NDBT_DataSet *,
108
bool rollback = false,
109
NDBT_DataSetAsyncTransactionCallback fun,
116
static void deleteByPk(Ndb * theNdbObject,
117
const NDBT_DataSet *,
118
bool rollback = false,
119
NDBT_DataSetAsyncTransactionCallback fun,
124
class NDBT_DataSetBulkOperation {
127
* Store the data into ndb
129
static void insert(Ndb * theNdbObject,
130
const NDBT_DataSet *,
131
int parallellTransactions = 1,
132
int operationsPerTransaction = 10);
135
* Read data (using pk) from ndb
137
static void readByPk(Ndb * theNdbObject,
139
int parallellTransactions = 1,
140
int operationsPerTransaction = 10);
143
* Update data using pk
146
static void updateByPk(Ndb * theNdbObject,
147
const NDBT_DataSet *,
148
int parallellTransactions = 1,
149
int operationsPerTransaction = 10);
154
static void deleteByPk(Ndb * theNdbObject,
155
const NDBT_DataSet *,
156
int parallellTransactions = 1,
157
int operationsPerTransaction = 10);