MySQL Forums
Forum List  »  NDB clusters

Transaction already aborted.
Posted by: Raghu DV
Date: September 18, 2017 12:05AM

I tried to execute the sample program here: https://dev.mysql.com/doc/ndbapi/en/ndb-examples-synchronous-transactions.html

I modified the table to store varchar data.
Table:
mysql> show create table KV_STORE;
+----------+----------------------------------------------------------------------------------------------------------------------------------------------
----------------+
| Table | Create Table
|
+----------+----------------------------------------------------------------------------------------------------------------------------------------------
----------------+
| KV_STORE | CREATE TABLE `KV_STORE` (
`ATTR1` varchar(25) NOT NULL,
`ATTR2` varchar(50) NOT NULL,
PRIMARY KEY (`ATTR1`)
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 |
+----------+----------------------------------------------------------------------------------------------------------------------------------------------
----------------+

I modified the do_insert to insert a string type data.

static void do_insert(Ndb &myNdb)
{
const NdbDictionary::Dictionary* myDict= myNdb.getDictionary();
const NdbDictionary::Table *myTable= myDict->getTable("KV_STORE");

if (myTable == NULL)
APIERROR(myDict->getNdbError());

NdbTransaction *myTransaction= myNdb.startTransaction();
if (myTransaction == NULL) APIERROR(myNdb.getNdbError());

NdbOperation *myOperation= myTransaction->getNdbOperation(myTable);
if (myOperation == NULL) APIERROR(myTransaction->getNdbError());

myOperation->insertTuple();
myOperation->equal("ATTR1", std::to_string(1).c_str());
myOperation->setValue("ATTR2", std::to_string(1).c_str());

if (myTransaction->execute( NdbTransaction::Commit ) == -1)
APIERROR(myTransaction->getNdbError());

myNdb.closeTransaction(myTransaction);

}

I am getting the following error:
NDB Cluster already has example table: KV_STORE. Dropping it...
Error in src/NdbThroughput.cc, line: 188, code: 4350, msg: Transaction already aborted.

Options: ReplyQuote


Subject
Views
Written By
Posted
Transaction already aborted.
940
September 18, 2017 12:05AM
452
September 19, 2017 08:09AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.