Commit a0e534c7 authored by unknown's avatar unknown

changed NdbConnection to NdbTransaction

parent 3410ce09
...@@ -119,7 +119,7 @@ int clear_table(Ndb* pNdb, const NdbDictionary::Table* pTab, int parallelism) ...@@ -119,7 +119,7 @@ int clear_table(Ndb* pNdb, const NdbDictionary::Table* pTab, int parallelism)
const int retryMax = 10; const int retryMax = 10;
int deletedRows = 0; int deletedRows = 0;
int check; int check;
NdbConnection *pTrans; NdbTransaction *pTrans;
NdbScanOperation *pOp; NdbScanOperation *pOp;
NdbError err; NdbError err;
......
...@@ -21,7 +21,7 @@ extern FilteredNdbOut err; ...@@ -21,7 +21,7 @@ extern FilteredNdbOut err;
extern FilteredNdbOut info; extern FilteredNdbOut info;
extern FilteredNdbOut debug; extern FilteredNdbOut debug;
static void callback(int, NdbConnection*, void*); static void callback(int, NdbTransaction*, void*);
extern const char * g_connect_string; extern const char * g_connect_string;
bool bool
...@@ -492,7 +492,7 @@ BackupRestore::logEntry(const LogEntry & tup) ...@@ -492,7 +492,7 @@ BackupRestore::logEntry(const LogEntry & tup)
if (!m_restore) if (!m_restore)
return; return;
NdbConnection * trans = m_ndb->startTransaction(); NdbTransaction * trans = m_ndb->startTransaction();
if (trans == NULL) if (trans == NULL)
{ {
// Deep shit, TODO: handle the error // Deep shit, TODO: handle the error
...@@ -584,12 +584,12 @@ BackupRestore::endOfLogEntrys() ...@@ -584,12 +584,12 @@ BackupRestore::endOfLogEntrys()
* *
* (This function must have three arguments: * (This function must have three arguments:
* - The result of the transaction, * - The result of the transaction,
* - The NdbConnection object, and * - The NdbTransaction object, and
* - A pointer to an arbitrary object.) * - A pointer to an arbitrary object.)
*/ */
static void static void
callback(int result, NdbConnection* trans, void* aObject) callback(int result, NdbTransaction* trans, void* aObject)
{ {
restore_callback_t *cb = (restore_callback_t *)aObject; restore_callback_t *cb = (restore_callback_t *)aObject;
(cb->restore)->cback(result, cb); (cb->restore)->cback(result, cb);
...@@ -603,7 +603,7 @@ BackupRestore::tuple(const TupleS & tup) ...@@ -603,7 +603,7 @@ BackupRestore::tuple(const TupleS & tup)
return; return;
while (1) while (1)
{ {
NdbConnection * trans = m_ndb->startTransaction(); NdbTransaction * trans = m_ndb->startTransaction();
if (trans == NULL) if (trans == NULL)
{ {
// Deep shit, TODO: handle the error // Deep shit, TODO: handle the error
......
...@@ -21,8 +21,8 @@ extern FilteredNdbOut err; ...@@ -21,8 +21,8 @@ extern FilteredNdbOut err;
extern FilteredNdbOut info; extern FilteredNdbOut info;
extern FilteredNdbOut debug; extern FilteredNdbOut debug;
static bool asynchErrorHandler(NdbConnection * trans, Ndb * ndb); static bool asynchErrorHandler(NdbTransaction * trans, Ndb * ndb);
static void callback(int result, NdbConnection* trans, void* aObject); static void callback(int result, NdbTransaction* trans, void* aObject);
bool bool
BackupRestore::init() BackupRestore::init()
...@@ -371,7 +371,7 @@ BackupRestore::tuple(const TupleS & tup) ...@@ -371,7 +371,7 @@ BackupRestore::tuple(const TupleS & tup)
return; return;
while (1) while (1)
{ {
NdbConnection * trans = m_ndb->startTransaction(); NdbTransaction * trans = m_ndb->startTransaction();
if (trans == NULL) if (trans == NULL)
{ {
// Deep shit, TODO: handle the error // Deep shit, TODO: handle the error
...@@ -460,7 +460,7 @@ BackupRestore::logEntry(const LogEntry & tup) ...@@ -460,7 +460,7 @@ BackupRestore::logEntry(const LogEntry & tup)
if (!m_restore) if (!m_restore)
return; return;
NdbConnection * trans = m_ndb->startTransaction(); NdbTransaction * trans = m_ndb->startTransaction();
if (trans == NULL) if (trans == NULL)
{ {
// Deep shit, TODO: handle the error // Deep shit, TODO: handle the error
...@@ -551,7 +551,7 @@ BackupRestore::endOfLogEntrys() ...@@ -551,7 +551,7 @@ BackupRestore::endOfLogEntrys()
* *
******************************************/ ******************************************/
static void restoreCallback(int result, // Result for transaction static void restoreCallback(int result, // Result for transaction
NdbConnection *object, // Transaction object NdbTransaction *object, // Transaction object
void *anything) // Not used void *anything) // Not used
{ {
static Uint32 counter = 0; static Uint32 counter = 0;
...@@ -593,12 +593,12 @@ static void restoreCallback(int result, // Result for transaction ...@@ -593,12 +593,12 @@ static void restoreCallback(int result, // Result for transaction
* *
* (This function must have three arguments: * (This function must have three arguments:
* - The result of the transaction, * - The result of the transaction,
* - The NdbConnection object, and * - The NdbTransaction object, and
* - A pointer to an arbitrary object.) * - A pointer to an arbitrary object.)
*/ */
static void static void
callback(int result, NdbConnection* trans, void* aObject) callback(int result, NdbTransaction* trans, void* aObject)
{ {
restore_callback_t *cb = (restore_callback_t *)aObject; restore_callback_t *cb = (restore_callback_t *)aObject;
(cb->restore)->cback(result, cb); (cb->restore)->cback(result, cb);
...@@ -610,7 +610,7 @@ callback(int result, NdbConnection* trans, void* aObject) ...@@ -610,7 +610,7 @@ callback(int result, NdbConnection* trans, void* aObject)
* false if it is an error that generates an abort. * false if it is an error that generates an abort.
*/ */
static static
bool asynchErrorHandler(NdbConnection * trans, Ndb* ndb) bool asynchErrorHandler(NdbTransaction * trans, Ndb* ndb)
{ {
NdbError error = trans->getNdbError(); NdbError error = trans->getNdbError();
ndb->closeTransaction(trans); ndb->closeTransaction(trans);
......
...@@ -194,7 +194,7 @@ int scanReadRecords(Ndb* pNdb, ...@@ -194,7 +194,7 @@ int scanReadRecords(Ndb* pNdb,
int retryAttempt = 0; int retryAttempt = 0;
const int retryMax = 100; const int retryMax = 100;
int check; int check;
NdbConnection *pTrans; NdbTransaction *pTrans;
NdbScanOperation *pOp; NdbScanOperation *pOp;
NdbIndexScanOperation * pIOp= 0; NdbIndexScanOperation * pIOp= 0;
......
...@@ -141,7 +141,7 @@ select_count(Ndb* pNdb, const NdbDictionary::Table* pTab, ...@@ -141,7 +141,7 @@ select_count(Ndb* pNdb, const NdbDictionary::Table* pTab,
int retryAttempt = 0; int retryAttempt = 0;
const int retryMax = 100; const int retryMax = 100;
int check; int check;
NdbConnection *pTrans; NdbTransaction *pTrans;
NdbScanOperation *pOp; NdbScanOperation *pOp;
while (true){ while (true){
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment