Bugfix of transaction
1) fix bugs of transaction api
2) fix a bug of transaction under read committed level
MODIFY
KVstore/IVArray/IVEntry.cpp
KVstore/IVArray/IVEntry.cpp
@@ -203,10 +203,12 @@ IVEntry::getLatestVersion(TYPE_TXN_ID TID, VDataSet &addset, VDataSet &delset)
for(unsigned i = 0; i < n - 1; i++)
{
vList[i]->get_version(addset, delset);
+ cout << "begin_ts" << vList[i]->get_begin_ts() << " end_ts" << vList[i]->get_end_ts() << endl;
}
- if((vList[n-1]->get_begin_ts() == INVALID_TS && vList[n-1]->get_end_ts() == TID) || (vList[n-1]->get_end_ts() == INVALID_TS && vList[n-1]->get_begin_ts() < TID)) //private version or committed version
+ if((vList[n-1]->get_begin_ts() == INVALID_TS && vList[n-1]->get_end_ts() == TID) || (vList[n-1]->get_end_ts() == INVALID_TS)) //private version or committed version
{
vList[n-1]->get_version(addset, delset);
+ cout << "begin_ts" << vList[n-1]->get_begin_ts() << " end_ts" << vList[n-1]->get_end_ts() << endl;
}
rwLatch.unlock();
}
@@ -367,6 +369,7 @@ IVEntry::UnLatch(shared_ptr<Transaction> txn, LatchType latch_type)
}
//update the version info(unlock)
//assert(vList[k-1]->get_end_ts() == TID);
+ cout << "cid..................." << cid << endl;
vList[k-1]->set_begin_ts(cid);
vList[k-1]->set_end_ts(INVALID_TS);
vList[k-2]->set_end_ts(cid);

MODIFY
api/http/cpp/client.cpp
api/http/cpp/client.cpp
@@ -571,13 +571,13 @@ std::string GstoreConnector::tquery(std::string db_name, std::string TID, std::s
std::string res;
if (request_type == "GET")
{
- std::string strUrl = this->Url + "/?operation=tquery&db_name=" + db_name + "&username=" + this->username + "&password=" + this->password + "&TID=" + TID + "&sparql=" + sparql;
+ std::string strUrl = this->Url + "/?operation=tquery&db_name=" + db_name + "&username=" + this->username + "&password=" + this->password + "&tid=" + TID + "&sparql=" + sparql;
int ret = this->Get(strUrl, res);
}
else if (request_type == "POST")
{
std::string strUrl = this->Url + "/export";
- std::string strPost = "{\"db_name\": \"" + db_name + "\", \"username\": \"" + this->username + "\", \"password\": \"" + this->password + "\", \"TID\": \"" + TID+ "\", \"sparql\": \"" + sparql + "\"}";
+ std::string strPost = "{\"db_name\": \"" + db_name + "\", \"username\": \"" + this->username + "\", \"password\": \"" + this->password + "\", \"tid\": \"" + TID+ "\", \"sparql\": \"" + sparql + "\"}";
int ret = this->Post(strUrl, strPost, res);
}
return res;
@@ -588,13 +588,13 @@ std::string GstoreConnector::commit(std::string db_name, std::string TID, std::s
std::string res;
if (request_type == "GET")
{
- std::string strUrl = this->Url + "/?operation=commit&db_name=" + db_name + "&username=" + this->username + "&password=" + this->password + "&TID=" + TID;
+ std::string strUrl = this->Url + "/?operation=commit&db_name=" + db_name + "&username=" + this->username + "&password=" + this->password + "&tid=" + TID;
int ret = this->Get(strUrl, res);
}
else if (request_type == "POST")
{
std::string strUrl = this->Url + "/export";
- std::string strPost = "{\"db_name\": \"" + db_name + "\", \"username\": \"" + this->username + "\", \"password\": \"" + this->password + "\", \"TID\": \"" + TID + "\"}";
+ std::string strPost = "{\"db_name\": \"" + db_name + "\", \"username\": \"" + this->username + "\", \"password\": \"" + this->password + "\", \"tid\": \"" + TID + "\"}";
int ret = this->Post(strUrl, strPost, res);
}
return res;
@@ -605,13 +605,13 @@ std::string GstoreConnector::rollback(std::string db_name, std::string TID, std:
std::string res;
if (request_type == "GET")
{
- std::string strUrl = this->Url + "/?operation=rollback&db_name=" + db_name + "&username=" + this->username + "&password=" + this->password + "&TID=" + TID;
+ std::string strUrl = this->Url + "/?operation=rollback&db_name=" + db_name + "&username=" + this->username + "&password=" + this->password + "&tid=" + TID;
int ret = this->Get(strUrl, res);
}
else if (request_type == "POST")
{
std::string strUrl = this->Url + "/rollback";
- std::string strPost = "{\"db_name\": \"" + db_name + "\", \"username\": \"" + this->username + "\", \"password\": \"" + this->password + "\", \"TID\": \"" + TID + "\"}";
+ std::string strPost = "{\"db_name\": \"" + db_name + "\", \"username\": \"" + this->username + "\", \"password\": \"" + this->password + "\", \"tid\": \"" + TID + "\"}";
int ret = this->Post(strUrl, strPost, res);
}
return res;

Bugfix of transaction
1) fix bugs of transaction api
2) fix a bug of transaction under read committed level