mirror of https://gitee.com/bigwinds/arangodb
pass vocbase in TransactionContext
This commit is contained in:
parent
3ac0c0c3af
commit
eb202f528c
|
@ -488,7 +488,7 @@ QueryResult Query::prepare(QueryRegistry* registry) {
|
|||
_isModificationQuery = parser->isModificationQuery();
|
||||
|
||||
// create the transaction object, but do not start it yet
|
||||
_trx = new arangodb::AqlTransaction(createTransactionContext(), _vocbase,
|
||||
_trx = new arangodb::AqlTransaction(createTransactionContext(),
|
||||
_collections.collections(),
|
||||
_part == PART_MAIN);
|
||||
|
||||
|
@ -973,7 +973,7 @@ QueryResult Query::explain() {
|
|||
// << "\n";
|
||||
|
||||
// create the transaction object, but do not start it yet
|
||||
_trx = new arangodb::AqlTransaction(createTransactionContext(), _vocbase,
|
||||
_trx = new arangodb::AqlTransaction(createTransactionContext(),
|
||||
_collections.collections(), true);
|
||||
|
||||
// we have an AST
|
||||
|
|
|
@ -574,7 +574,7 @@ int ContinuousSyncer::processDocument(TRI_replication_operation_e type,
|
|||
// standalone operation
|
||||
// update the apply tick for all standalone operations
|
||||
SingleCollectionTransaction trx(StandaloneTransactionContext::Create(_vocbase),
|
||||
_vocbase, cid, TRI_TRANSACTION_WRITE);
|
||||
cid, TRI_TRANSACTION_WRITE);
|
||||
|
||||
int res = trx.begin();
|
||||
|
||||
|
|
|
@ -757,7 +757,7 @@ int InitialSyncer::handleCollectionDump(
|
|||
}
|
||||
|
||||
if (res == TRI_ERROR_NO_ERROR) {
|
||||
SingleCollectionTransaction trx(StandaloneTransactionContext::Create(_vocbase), _vocbase, col->_cid, TRI_TRANSACTION_WRITE);
|
||||
SingleCollectionTransaction trx(StandaloneTransactionContext::Create(_vocbase), col->_cid, TRI_TRANSACTION_WRITE);
|
||||
|
||||
res = trx.begin();
|
||||
|
||||
|
@ -970,7 +970,7 @@ int InitialSyncer::handleCollectionSync(
|
|||
|
||||
if (countJson->_value._number <= 0.0) {
|
||||
// remote collection has no documents. now truncate our local collection
|
||||
SingleCollectionTransaction trx(StandaloneTransactionContext::Create(_vocbase), _vocbase, col->_cid, TRI_TRANSACTION_WRITE);
|
||||
SingleCollectionTransaction trx(StandaloneTransactionContext::Create(_vocbase), col->_cid, TRI_TRANSACTION_WRITE);
|
||||
|
||||
int res = trx.begin();
|
||||
|
||||
|
@ -1037,7 +1037,7 @@ int InitialSyncer::handleSyncKeys(TRI_vocbase_col_t* col,
|
|||
// acquire a replication ditch so no datafiles are thrown away from now on
|
||||
// note: the ditch also protects against unloading the collection
|
||||
{
|
||||
SingleCollectionTransaction trx(StandaloneTransactionContext::Create(_vocbase), _vocbase, col->_cid, TRI_TRANSACTION_READ);
|
||||
SingleCollectionTransaction trx(StandaloneTransactionContext::Create(_vocbase), col->_cid, TRI_TRANSACTION_READ);
|
||||
|
||||
int res = trx.begin();
|
||||
|
||||
|
@ -1060,7 +1060,7 @@ int InitialSyncer::handleSyncKeys(TRI_vocbase_col_t* col,
|
|||
TRI_DEFER(document->ditches()->freeDitch(ditch));
|
||||
|
||||
{
|
||||
SingleCollectionTransaction trx(StandaloneTransactionContext::Create(_vocbase), _vocbase, col->_cid, TRI_TRANSACTION_READ);
|
||||
SingleCollectionTransaction trx(StandaloneTransactionContext::Create(_vocbase), col->_cid, TRI_TRANSACTION_READ);
|
||||
|
||||
int res = trx.begin();
|
||||
|
||||
|
@ -1180,7 +1180,7 @@ int InitialSyncer::handleSyncKeys(TRI_vocbase_col_t* col,
|
|||
// remove all keys that are below first remote key or beyond last remote key
|
||||
if (n > 0) {
|
||||
// first chunk
|
||||
SingleCollectionTransaction trx(StandaloneTransactionContext::Create(_vocbase), _vocbase, col->_cid, TRI_TRANSACTION_WRITE);
|
||||
SingleCollectionTransaction trx(StandaloneTransactionContext::Create(_vocbase), col->_cid, TRI_TRANSACTION_WRITE);
|
||||
|
||||
int res = trx.begin();
|
||||
|
||||
|
@ -1245,7 +1245,7 @@ int InitialSyncer::handleSyncKeys(TRI_vocbase_col_t* col,
|
|||
return TRI_ERROR_REPLICATION_APPLIER_STOPPED;
|
||||
}
|
||||
|
||||
SingleCollectionTransaction trx(StandaloneTransactionContext::Create(_vocbase), _vocbase, col->_cid, TRI_TRANSACTION_WRITE);
|
||||
SingleCollectionTransaction trx(StandaloneTransactionContext::Create(_vocbase), col->_cid, TRI_TRANSACTION_WRITE);
|
||||
|
||||
int res = trx.begin();
|
||||
|
||||
|
@ -1691,7 +1691,7 @@ int InitialSyncer::changeCollection(TRI_vocbase_col_t* col,
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
int64_t InitialSyncer::getSize(TRI_vocbase_col_t* col) {
|
||||
SingleCollectionTransaction trx(StandaloneTransactionContext::Create(_vocbase), _vocbase, col->_cid, TRI_TRANSACTION_READ);
|
||||
SingleCollectionTransaction trx(StandaloneTransactionContext::Create(_vocbase), col->_cid, TRI_TRANSACTION_READ);
|
||||
|
||||
int res = trx.begin();
|
||||
|
||||
|
@ -1785,7 +1785,7 @@ int InitialSyncer::handleCollection(TRI_json_t const* parameters,
|
|||
// system collection
|
||||
setProgress("truncating " + collectionMsg);
|
||||
|
||||
SingleCollectionTransaction trx(StandaloneTransactionContext::Create(_vocbase), _vocbase, col->_cid, TRI_TRANSACTION_WRITE);
|
||||
SingleCollectionTransaction trx(StandaloneTransactionContext::Create(_vocbase), col->_cid, TRI_TRANSACTION_WRITE);
|
||||
|
||||
int res = trx.begin();
|
||||
|
||||
|
@ -1913,7 +1913,7 @@ int InitialSyncer::handleCollection(TRI_json_t const* parameters,
|
|||
setProgress(progress);
|
||||
|
||||
try {
|
||||
SingleCollectionTransaction trx(StandaloneTransactionContext::Create(_vocbase), _vocbase, col->_cid, TRI_TRANSACTION_WRITE);
|
||||
SingleCollectionTransaction trx(StandaloneTransactionContext::Create(_vocbase), col->_cid, TRI_TRANSACTION_WRITE);
|
||||
|
||||
res = trx.begin();
|
||||
|
||||
|
|
|
@ -612,7 +612,7 @@ int Syncer::createIndex(VPackSlice const& slice) {
|
|||
|
||||
TRI_document_collection_t* document = guard.collection()->_collection;
|
||||
|
||||
SingleCollectionTransaction trx(StandaloneTransactionContext::Create(_vocbase), _vocbase, guard.collection()->_cid, TRI_TRANSACTION_WRITE);
|
||||
SingleCollectionTransaction trx(StandaloneTransactionContext::Create(_vocbase), guard.collection()->_cid, TRI_TRANSACTION_WRITE);
|
||||
|
||||
int res = trx.begin();
|
||||
|
||||
|
|
|
@ -123,7 +123,7 @@ bool RestDocumentHandler::createDocument() {
|
|||
|
||||
// find and load collection given by name or identifier
|
||||
SingleCollectionTransaction trx(StandaloneTransactionContext::Create(_vocbase),
|
||||
_vocbase, collection, TRI_TRANSACTION_WRITE);
|
||||
collection, TRI_TRANSACTION_WRITE);
|
||||
|
||||
// .............................................................................
|
||||
// inside write transaction
|
||||
|
@ -265,7 +265,7 @@ bool RestDocumentHandler::readSingleDocument(bool generateBody) {
|
|||
|
||||
// find and load collection given by name or identifier
|
||||
SingleCollectionTransaction trx(StandaloneTransactionContext::Create(_vocbase),
|
||||
_vocbase, collection, TRI_TRANSACTION_READ);
|
||||
collection, TRI_TRANSACTION_READ);
|
||||
|
||||
// .............................................................................
|
||||
// inside read transaction
|
||||
|
@ -377,7 +377,7 @@ bool RestDocumentHandler::readAllDocuments() {
|
|||
|
||||
// find and load collection given by name or identifier
|
||||
SingleCollectionTransaction trx(StandaloneTransactionContext::Create(_vocbase),
|
||||
_vocbase, collection, TRI_TRANSACTION_READ);
|
||||
collection, TRI_TRANSACTION_READ);
|
||||
|
||||
std::vector<std::string> ids;
|
||||
|
||||
|
@ -569,7 +569,7 @@ bool RestDocumentHandler::modifyDocument(bool isPatch) {
|
|||
|
||||
// find and load collection given by name or identifier
|
||||
SingleCollectionTransaction trx(StandaloneTransactionContext::Create(_vocbase),
|
||||
_vocbase, collection, TRI_TRANSACTION_WRITE);
|
||||
collection, TRI_TRANSACTION_WRITE);
|
||||
|
||||
// .............................................................................
|
||||
// inside write transaction
|
||||
|
@ -709,7 +709,7 @@ bool RestDocumentHandler::deleteDocument() {
|
|||
}
|
||||
|
||||
SingleCollectionTransaction trx(StandaloneTransactionContext::Create(_vocbase),
|
||||
_vocbase, collection, TRI_TRANSACTION_WRITE);
|
||||
collection, TRI_TRANSACTION_WRITE);
|
||||
|
||||
// .............................................................................
|
||||
// inside write transaction
|
||||
|
|
|
@ -127,7 +127,7 @@ bool RestEdgeHandler::createDocument() {
|
|||
|
||||
// find and load collection given by name or identifier
|
||||
SingleCollectionTransaction trx(StandaloneTransactionContext::Create(_vocbase),
|
||||
_vocbase, collection, TRI_TRANSACTION_WRITE);
|
||||
collection, TRI_TRANSACTION_WRITE);
|
||||
|
||||
// .............................................................................
|
||||
// inside write transaction
|
||||
|
|
|
@ -192,7 +192,7 @@ bool RestEdgesHandler::readEdges(
|
|||
|
||||
// find and load collection given by name or identifier
|
||||
SingleCollectionTransaction trx(StandaloneTransactionContext::Create(_vocbase),
|
||||
_vocbase, collectionName, TRI_TRANSACTION_READ);
|
||||
collectionName, TRI_TRANSACTION_READ);
|
||||
|
||||
// .............................................................................
|
||||
// inside read transaction
|
||||
|
@ -321,7 +321,7 @@ bool RestEdgesHandler::readEdgesForMultipleVertices() {
|
|||
|
||||
// find and load collection given by name or identifier
|
||||
SingleCollectionTransaction trx(StandaloneTransactionContext::Create(_vocbase),
|
||||
_vocbase, collectionName, TRI_TRANSACTION_READ);
|
||||
collectionName, TRI_TRANSACTION_READ);
|
||||
|
||||
// .............................................................................
|
||||
// inside read transaction
|
||||
|
|
|
@ -372,7 +372,7 @@ bool RestImportHandler::createFromJson(std::string const& type) {
|
|||
}
|
||||
|
||||
// find and load collection given by name or identifier
|
||||
SingleCollectionTransaction trx(StandaloneTransactionContext::Create(_vocbase), _vocbase,
|
||||
SingleCollectionTransaction trx(StandaloneTransactionContext::Create(_vocbase),
|
||||
collection, TRI_TRANSACTION_WRITE);
|
||||
|
||||
// .............................................................................
|
||||
|
@ -625,7 +625,7 @@ bool RestImportHandler::createFromKeyValueList() {
|
|||
current = next + 1;
|
||||
|
||||
// find and load collection given by name or identifier
|
||||
SingleCollectionTransaction trx(StandaloneTransactionContext::Create(_vocbase), _vocbase,
|
||||
SingleCollectionTransaction trx(StandaloneTransactionContext::Create(_vocbase),
|
||||
collection, TRI_TRANSACTION_WRITE);
|
||||
|
||||
// .............................................................................
|
||||
|
|
|
@ -1498,7 +1498,7 @@ int RestReplicationHandler::processRestoreCollection(
|
|||
// some collections must not be dropped
|
||||
|
||||
// instead, truncate them
|
||||
SingleCollectionTransaction trx(StandaloneTransactionContext::Create(_vocbase), _vocbase, col->_cid, TRI_TRANSACTION_WRITE);
|
||||
SingleCollectionTransaction trx(StandaloneTransactionContext::Create(_vocbase), col->_cid, TRI_TRANSACTION_WRITE);
|
||||
|
||||
res = trx.begin();
|
||||
if (res != TRI_ERROR_NO_ERROR) {
|
||||
|
@ -1786,7 +1786,7 @@ int RestReplicationHandler::processRestoreIndexes(VPackSlice const& collection,
|
|||
|
||||
TRI_document_collection_t* document = guard.collection()->_collection;
|
||||
|
||||
SingleCollectionTransaction trx(StandaloneTransactionContext::Create(_vocbase), _vocbase, document->_info.id(), TRI_TRANSACTION_WRITE);
|
||||
SingleCollectionTransaction trx(StandaloneTransactionContext::Create(_vocbase), document->_info.id(), TRI_TRANSACTION_WRITE);
|
||||
|
||||
int res = trx.begin();
|
||||
|
||||
|
@ -2190,7 +2190,7 @@ int RestReplicationHandler::processRestoreDataBatch(
|
|||
int RestReplicationHandler::processRestoreData(
|
||||
CollectionNameResolver const& resolver, TRI_voc_cid_t cid, bool useRevision,
|
||||
bool force, std::string& errorMsg) {
|
||||
SingleCollectionTransaction trx(StandaloneTransactionContext::Create(_vocbase), _vocbase, cid, TRI_TRANSACTION_WRITE);
|
||||
SingleCollectionTransaction trx(StandaloneTransactionContext::Create(_vocbase), cid, TRI_TRANSACTION_WRITE);
|
||||
|
||||
int res = trx.begin();
|
||||
|
||||
|
@ -3602,7 +3602,7 @@ void RestReplicationHandler::handleCommandAddFollower() {
|
|||
|
||||
// find and load collection given by name or identifier
|
||||
SingleCollectionTransaction trx(StandaloneTransactionContext::Create(_vocbase),
|
||||
_vocbase, shard.copyString(), TRI_TRANSACTION_WRITE);
|
||||
shard.copyString(), TRI_TRANSACTION_WRITE);
|
||||
int res = trx.begin();
|
||||
if (res != TRI_ERROR_NO_ERROR) {
|
||||
generateError(HttpResponse::SERVER_ERROR, TRI_ERROR_HTTP_SERVER_ERROR,
|
||||
|
|
|
@ -44,10 +44,10 @@ class AqlTransaction : public Transaction {
|
|||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
AqlTransaction(
|
||||
std::shared_ptr<TransactionContext> transactionContext, TRI_vocbase_t* vocbase,
|
||||
std::shared_ptr<TransactionContext> transactionContext,
|
||||
std::map<std::string, arangodb::aql::Collection*> const* collections,
|
||||
bool isMainTransaction)
|
||||
: Transaction(transactionContext, vocbase, 0),
|
||||
: Transaction(transactionContext, 0),
|
||||
_collections(*collections) {
|
||||
if (!isMainTransaction) {
|
||||
this->addHint(TRI_TRANSACTION_HINT_LOCK_NEVER, true);
|
||||
|
@ -164,7 +164,7 @@ class AqlTransaction : public Transaction {
|
|||
|
||||
arangodb::AqlTransaction* clone() const {
|
||||
return new arangodb::AqlTransaction(
|
||||
arangodb::StandaloneTransactionContext::Create(this->_vocbase), this->_vocbase,
|
||||
arangodb::StandaloneTransactionContext::Create(this->_vocbase),
|
||||
&_collections, false);
|
||||
}
|
||||
|
||||
|
|
|
@ -98,7 +98,7 @@ void CollectionExport::run(uint64_t maxWaitTime, size_t limit) {
|
|||
|
||||
{
|
||||
SingleCollectionTransaction trx(StandaloneTransactionContext::Create(_document->_vocbase),
|
||||
_document->_vocbase, _name, TRI_TRANSACTION_READ);
|
||||
_name, TRI_TRANSACTION_READ);
|
||||
|
||||
trx.addHint(TRI_TRANSACTION_HINT_NO_USAGE_LOCK,
|
||||
true); // already locked by guard above
|
||||
|
|
|
@ -108,7 +108,7 @@ void CollectionKeys::create(TRI_voc_tick_t maxTick) {
|
|||
// copy all datafile markers into the result under the read-lock
|
||||
{
|
||||
SingleCollectionTransaction trx(StandaloneTransactionContext::Create(_document->_vocbase),
|
||||
_document->_vocbase, _name, TRI_TRANSACTION_READ);
|
||||
_name, TRI_TRANSACTION_READ);
|
||||
|
||||
int res = trx.begin();
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@ class ExplicitTransaction : public Transaction {
|
|||
std::vector<std::string> const& writeCollections,
|
||||
double lockTimeout, bool waitForSync, bool embed,
|
||||
bool allowImplicitCollections)
|
||||
: Transaction(V8TransactionContext::Create(vocbase, embed), vocbase, 0) {
|
||||
: Transaction(V8TransactionContext::Create(vocbase, embed), 0) {
|
||||
this->addHint(TRI_TRANSACTION_HINT_LOCK_ENTIRELY, false);
|
||||
|
||||
if (lockTimeout >= 0.0) {
|
||||
|
@ -76,7 +76,7 @@ class ExplicitTransaction : public Transaction {
|
|||
std::vector<TRI_voc_cid_t> const& readCollections,
|
||||
std::vector<TRI_voc_cid_t> const& writeCollections,
|
||||
double lockTimeout, bool waitForSync, bool embed)
|
||||
: Transaction(V8TransactionContext::Create(vocbase, embed), vocbase, 0) {
|
||||
: Transaction(V8TransactionContext::Create(vocbase, embed), 0) {
|
||||
this->addHint(TRI_TRANSACTION_HINT_LOCK_ENTIRELY, false);
|
||||
|
||||
if (lockTimeout >= 0.0) {
|
||||
|
|
|
@ -43,7 +43,7 @@ class ReplicationTransaction : public Transaction {
|
|||
|
||||
ReplicationTransaction(TRI_server_t* server, TRI_vocbase_t* vocbase,
|
||||
TRI_voc_tid_t externalId)
|
||||
: Transaction(StandaloneTransactionContext::Create(vocbase), vocbase, externalId),
|
||||
: Transaction(StandaloneTransactionContext::Create(vocbase), externalId),
|
||||
_server(server),
|
||||
_externalId(externalId) {
|
||||
TRI_UseDatabaseServer(_server, vocbase->_name);
|
||||
|
|
|
@ -43,9 +43,8 @@ class SingleCollectionTransaction : public Transaction {
|
|||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
SingleCollectionTransaction(std::shared_ptr<TransactionContext> transactionContext,
|
||||
TRI_vocbase_t* vocbase, TRI_voc_cid_t cid,
|
||||
TRI_transaction_type_e accessType)
|
||||
: Transaction(transactionContext, vocbase, 0),
|
||||
TRI_voc_cid_t cid, TRI_transaction_type_e accessType)
|
||||
: Transaction(transactionContext, 0),
|
||||
_cid(cid),
|
||||
_trxCollection(nullptr),
|
||||
_documentCollection(nullptr),
|
||||
|
@ -59,9 +58,8 @@ class SingleCollectionTransaction : public Transaction {
|
|||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
SingleCollectionTransaction(std::shared_ptr<TransactionContext> transactionContext,
|
||||
TRI_vocbase_t* vocbase, std::string const& name,
|
||||
TRI_transaction_type_e accessType)
|
||||
: Transaction(transactionContext, vocbase, 0),
|
||||
std::string const& name, TRI_transaction_type_e accessType)
|
||||
: Transaction(transactionContext, 0),
|
||||
_cid(0),
|
||||
_trxCollection(nullptr),
|
||||
_documentCollection(nullptr),
|
||||
|
|
|
@ -67,13 +67,12 @@ class Transaction {
|
|||
Transaction(Transaction const&) = delete;
|
||||
Transaction& operator=(Transaction const&) = delete;
|
||||
|
||||
public:
|
||||
protected:
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief create the transaction
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Transaction(std::shared_ptr<TransactionContext> transactionContext, TRI_vocbase_t* vocbase,
|
||||
TRI_voc_tid_t externalId)
|
||||
Transaction(std::shared_ptr<TransactionContext> transactionContext, TRI_voc_tid_t externalId)
|
||||
: _externalId(externalId),
|
||||
_setupState(TRI_ERROR_NO_ERROR),
|
||||
_nestingLevel(0),
|
||||
|
@ -84,7 +83,7 @@ class Transaction {
|
|||
_allowImplicitCollections(true),
|
||||
_isReal(true),
|
||||
_trx(nullptr),
|
||||
_vocbase(vocbase),
|
||||
_vocbase(transactionContext->vocbase()),
|
||||
_transactionContext(transactionContext) {
|
||||
TRI_ASSERT(_vocbase != nullptr);
|
||||
TRI_ASSERT(_transactionContext != nullptr);
|
||||
|
@ -96,6 +95,7 @@ class Transaction {
|
|||
this->setupTransaction();
|
||||
}
|
||||
|
||||
public:
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief destroy the transaction
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -350,7 +350,7 @@ static void ExistsVocbaseVPack(
|
|||
TRI_ASSERT(search.isObject());
|
||||
|
||||
SingleCollectionTransaction trx(V8TransactionContext::Create(vocbase, true),
|
||||
vocbase, collectionName, TRI_TRANSACTION_READ);
|
||||
collectionName, TRI_TRANSACTION_READ);
|
||||
|
||||
res = trx.begin();
|
||||
|
||||
|
@ -478,7 +478,7 @@ static void ReplaceVocbaseCol(bool useCollection,
|
|||
TRI_ASSERT(search.isObject());
|
||||
|
||||
SingleCollectionTransaction trx(V8TransactionContext::Create(vocbase, true),
|
||||
vocbase, collectionName, TRI_TRANSACTION_WRITE);
|
||||
collectionName, TRI_TRANSACTION_WRITE);
|
||||
res = trx.begin();
|
||||
|
||||
if (res != TRI_ERROR_NO_ERROR) {
|
||||
|
@ -581,7 +581,7 @@ static void DocumentVocbaseVPack(
|
|||
TRI_ASSERT(search.isObject());
|
||||
|
||||
SingleCollectionTransaction trx(V8TransactionContext::Create(vocbase, true),
|
||||
vocbase, collectionName, TRI_TRANSACTION_READ);
|
||||
collectionName, TRI_TRANSACTION_READ);
|
||||
|
||||
res = trx.begin();
|
||||
|
||||
|
@ -719,7 +719,7 @@ static void UpdateVocbaseVPack(bool useCollection,
|
|||
TRI_ASSERT(search.isObject());
|
||||
|
||||
SingleCollectionTransaction trx(V8TransactionContext::Create(vocbase, true),
|
||||
vocbase, collectionName, TRI_TRANSACTION_WRITE);
|
||||
collectionName, TRI_TRANSACTION_WRITE);
|
||||
res = trx.begin();
|
||||
|
||||
if (res != TRI_ERROR_NO_ERROR) {
|
||||
|
@ -841,7 +841,7 @@ static void RemoveVocbaseVPack(
|
|||
TRI_ASSERT(toRemove.isObject());
|
||||
|
||||
SingleCollectionTransaction trx(V8TransactionContext::Create(vocbase, true),
|
||||
vocbase, collectionName, TRI_TRANSACTION_WRITE);
|
||||
collectionName, TRI_TRANSACTION_WRITE);
|
||||
|
||||
res = trx.begin();
|
||||
|
||||
|
@ -984,7 +984,7 @@ static TRI_doc_collection_info_t* GetFiguresCoordinator(
|
|||
static TRI_doc_collection_info_t* GetFigures(TRI_vocbase_col_t* collection) {
|
||||
TRI_ASSERT(collection != nullptr);
|
||||
|
||||
SingleCollectionTransaction trx(V8TransactionContext::Create(collection->_vocbase, true), collection->_vocbase, collection->_cid, TRI_TRANSACTION_READ);
|
||||
SingleCollectionTransaction trx(V8TransactionContext::Create(collection->_vocbase, true), collection->_cid, TRI_TRANSACTION_READ);
|
||||
|
||||
int res = trx.begin();
|
||||
|
||||
|
@ -1643,7 +1643,7 @@ static void JS_ReplaceVocbaseCol(
|
|||
static int GetRevision(TRI_vocbase_col_t* collection, TRI_voc_rid_t& rid) {
|
||||
TRI_ASSERT(collection != nullptr);
|
||||
|
||||
SingleCollectionTransaction trx(V8TransactionContext::Create(collection->_vocbase, true), collection->_vocbase, collection->_cid, TRI_TRANSACTION_READ);
|
||||
SingleCollectionTransaction trx(V8TransactionContext::Create(collection->_vocbase, true), collection->_cid, TRI_TRANSACTION_READ);
|
||||
|
||||
int res = trx.begin();
|
||||
|
||||
|
@ -1825,7 +1825,7 @@ static void JS_SaveVocbase(v8::FunctionCallbackInfo<v8::Value> const& args) {
|
|||
|
||||
// load collection
|
||||
SingleCollectionTransaction trx(V8TransactionContext::Create(vocbase, true),
|
||||
vocbase, collectionName, TRI_TRANSACTION_WRITE);
|
||||
collectionName, TRI_TRANSACTION_WRITE);
|
||||
res = trx.begin();
|
||||
|
||||
if (res != TRI_ERROR_NO_ERROR) {
|
||||
|
@ -1935,7 +1935,7 @@ static void JS_InsertVocbaseVPack(
|
|||
|
||||
// load collection
|
||||
SingleCollectionTransaction trx(V8TransactionContext::Create(collection->_vocbase, true),
|
||||
collection->_vocbase, collection->_cid, TRI_TRANSACTION_WRITE);
|
||||
collection->_cid, TRI_TRANSACTION_WRITE);
|
||||
|
||||
res = trx.begin();
|
||||
|
||||
|
@ -2021,7 +2021,7 @@ static void JS_TruncateVocbaseCol(
|
|||
TRI_V8_THROW_EXCEPTION_INTERNAL("cannot extract collection");
|
||||
}
|
||||
|
||||
SingleCollectionTransaction trx(V8TransactionContext::Create(collection->_vocbase, true), collection->_vocbase, collection->_cid, TRI_TRANSACTION_WRITE);
|
||||
SingleCollectionTransaction trx(V8TransactionContext::Create(collection->_vocbase, true), collection->_cid, TRI_TRANSACTION_WRITE);
|
||||
|
||||
int res = trx.begin();
|
||||
|
||||
|
@ -2267,7 +2267,7 @@ static void JS_CheckPointersVocbaseCol(
|
|||
|
||||
TRI_THROW_SHARDING_COLLECTION_NOT_YET_IMPLEMENTED(collection);
|
||||
|
||||
SingleCollectionTransaction trx(V8TransactionContext::Create(collection->_vocbase, true), collection->_vocbase, collection->_cid, TRI_TRANSACTION_READ);
|
||||
SingleCollectionTransaction trx(V8TransactionContext::Create(collection->_vocbase, true), collection->_cid, TRI_TRANSACTION_READ);
|
||||
|
||||
int res = trx.begin();
|
||||
|
||||
|
@ -2592,7 +2592,7 @@ static void JS_CountVocbaseCol(
|
|||
|
||||
std::string collectionName(col->name());
|
||||
|
||||
SingleCollectionTransaction trx(V8TransactionContext::Create(vocbase, true), vocbase, collectionName, TRI_TRANSACTION_READ);
|
||||
SingleCollectionTransaction trx(V8TransactionContext::Create(vocbase, true), collectionName, TRI_TRANSACTION_READ);
|
||||
|
||||
int res = trx.begin();
|
||||
|
||||
|
|
|
@ -542,7 +542,7 @@ static void ExecuteSkiplistQuery(
|
|||
TRI_THROW_SHARDING_COLLECTION_NOT_YET_IMPLEMENTED(col);
|
||||
|
||||
SingleCollectionTransaction trx(V8TransactionContext::Create(col->_vocbase, true),
|
||||
col->_vocbase, col->_cid, TRI_TRANSACTION_WRITE);
|
||||
col->_cid, TRI_TRANSACTION_WRITE);
|
||||
|
||||
int res = trx.begin();
|
||||
|
||||
|
@ -810,7 +810,7 @@ static void EdgesQuery(TRI_edge_direction_e direction,
|
|||
}
|
||||
|
||||
SingleCollectionTransaction trx(V8TransactionContext::Create(col->_vocbase, true),
|
||||
col->_vocbase, col->_cid, TRI_TRANSACTION_READ);
|
||||
col->_cid, TRI_TRANSACTION_READ);
|
||||
|
||||
res = trx.begin();
|
||||
|
||||
|
@ -858,7 +858,7 @@ static void JS_AllQuery(v8::FunctionCallbackInfo<v8::Value> const& args) {
|
|||
TRI_voc_cid_t cid = col->_cid;
|
||||
|
||||
SingleCollectionTransaction trx(V8TransactionContext::Create(col->_vocbase, true),
|
||||
col->_vocbase, cid, TRI_TRANSACTION_READ);
|
||||
cid, TRI_TRANSACTION_READ);
|
||||
|
||||
int res = trx.begin();
|
||||
|
||||
|
@ -939,7 +939,7 @@ static void JS_AnyQuery(v8::FunctionCallbackInfo<v8::Value> const& args) {
|
|||
TRI_doc_mptr_copy_t document;
|
||||
|
||||
SingleCollectionTransaction trx(V8TransactionContext::Create(col->_vocbase, true),
|
||||
col->_vocbase, col->_cid, TRI_TRANSACTION_READ);
|
||||
col->_cid, TRI_TRANSACTION_READ);
|
||||
|
||||
int res = trx.begin();
|
||||
|
||||
|
@ -1002,7 +1002,7 @@ static void JS_ByExampleQuery(v8::FunctionCallbackInfo<v8::Value> const& args) {
|
|||
TRI_THROW_SHARDING_COLLECTION_NOT_YET_IMPLEMENTED(col);
|
||||
|
||||
SingleCollectionTransaction trx(V8TransactionContext::Create(col->_vocbase, true),
|
||||
col->_vocbase, col->_cid, TRI_TRANSACTION_READ);
|
||||
col->_cid, TRI_TRANSACTION_READ);
|
||||
|
||||
int res = trx.begin();
|
||||
|
||||
|
@ -1236,7 +1236,7 @@ static void JS_ByExampleHashIndex(
|
|||
TRI_THROW_SHARDING_COLLECTION_NOT_YET_IMPLEMENTED(col);
|
||||
|
||||
SingleCollectionTransaction trx(V8TransactionContext::Create(col->_vocbase, true),
|
||||
col->_vocbase, col->_cid, TRI_TRANSACTION_READ);
|
||||
col->_cid, TRI_TRANSACTION_READ);
|
||||
|
||||
int res = trx.begin();
|
||||
|
||||
|
@ -1422,7 +1422,7 @@ static void JS_ChecksumCollection(
|
|||
}
|
||||
|
||||
SingleCollectionTransaction trx(V8TransactionContext::Create(col->_vocbase, true),
|
||||
col->_vocbase, col->_cid, TRI_TRANSACTION_READ);
|
||||
col->_cid, TRI_TRANSACTION_READ);
|
||||
|
||||
int res = trx.begin();
|
||||
|
||||
|
@ -1633,7 +1633,7 @@ static void JS_FulltextQuery(v8::FunctionCallbackInfo<v8::Value> const& args) {
|
|||
TRI_THROW_SHARDING_COLLECTION_NOT_YET_IMPLEMENTED(col);
|
||||
|
||||
SingleCollectionTransaction trx(V8TransactionContext::Create(col->_vocbase, true),
|
||||
col->_vocbase, col->_cid, TRI_TRANSACTION_READ);
|
||||
col->_cid, TRI_TRANSACTION_READ);
|
||||
|
||||
int res = trx.begin();
|
||||
|
||||
|
@ -1735,7 +1735,7 @@ static void JS_NearQuery(v8::FunctionCallbackInfo<v8::Value> const& args) {
|
|||
TRI_THROW_SHARDING_COLLECTION_NOT_YET_IMPLEMENTED(col);
|
||||
|
||||
SingleCollectionTransaction trx(V8TransactionContext::Create(col->_vocbase, true),
|
||||
col->_vocbase, col->_cid, TRI_TRANSACTION_READ);
|
||||
col->_cid, TRI_TRANSACTION_READ);
|
||||
|
||||
int res = trx.begin();
|
||||
|
||||
|
@ -1837,7 +1837,7 @@ static void JS_WithinQuery(v8::FunctionCallbackInfo<v8::Value> const& args) {
|
|||
TRI_THROW_SHARDING_COLLECTION_NOT_YET_IMPLEMENTED(col);
|
||||
|
||||
SingleCollectionTransaction trx(V8TransactionContext::Create(col->_vocbase, true),
|
||||
col->_vocbase, col->_cid, TRI_TRANSACTION_READ);
|
||||
col->_cid, TRI_TRANSACTION_READ);
|
||||
|
||||
int res = trx.begin();
|
||||
|
||||
|
|
|
@ -553,7 +553,7 @@ static void EnsureIndexLocal(v8::FunctionCallbackInfo<v8::Value> const& args,
|
|||
}
|
||||
}
|
||||
|
||||
SingleCollectionTransaction trx(V8TransactionContext::Create(collection->_vocbase, true), collection->_vocbase, collection->_cid, TRI_TRANSACTION_WRITE);
|
||||
SingleCollectionTransaction trx(V8TransactionContext::Create(collection->_vocbase, true), collection->_cid, TRI_TRANSACTION_WRITE);
|
||||
|
||||
int res = trx.begin();
|
||||
|
||||
|
@ -1178,7 +1178,7 @@ static void JS_DropIndexVocbaseCol(
|
|||
return;
|
||||
}
|
||||
|
||||
SingleCollectionTransaction trx(V8TransactionContext::Create(collection->_vocbase, true), collection->_vocbase, collection->_cid, TRI_TRANSACTION_WRITE);
|
||||
SingleCollectionTransaction trx(V8TransactionContext::Create(collection->_vocbase, true), collection->_cid, TRI_TRANSACTION_WRITE);
|
||||
|
||||
int res = trx.begin();
|
||||
|
||||
|
@ -1287,7 +1287,7 @@ static void JS_GetIndexesVocbaseCol(
|
|||
withFigures = TRI_ObjectToBoolean(args[0]);
|
||||
}
|
||||
|
||||
SingleCollectionTransaction trx(V8TransactionContext::Create(collection->_vocbase, true), collection->_vocbase, collection->_cid, TRI_TRANSACTION_READ);
|
||||
SingleCollectionTransaction trx(V8TransactionContext::Create(collection->_vocbase, true), collection->_cid, TRI_TRANSACTION_READ);
|
||||
|
||||
int res = trx.begin();
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ arangodb::aql::Graph* arangodb::lookupGraphByName(TRI_vocbase_t* vocbase,
|
|||
std::string const& name) {
|
||||
|
||||
SingleCollectionTransaction trx(StandaloneTransactionContext::Create(vocbase),
|
||||
vocbase, GRAPHS, TRI_TRANSACTION_READ);
|
||||
GRAPHS, TRI_TRANSACTION_READ);
|
||||
|
||||
int res = trx.begin();
|
||||
|
||||
|
|
|
@ -354,7 +354,7 @@ bool TRI_LoadAuthInfo(TRI_vocbase_t* vocbase) {
|
|||
}
|
||||
|
||||
SingleCollectionTransaction trx(StandaloneTransactionContext::Create(vocbase),
|
||||
vocbase, collection->_cid, TRI_TRANSACTION_READ);
|
||||
collection->_cid, TRI_TRANSACTION_READ);
|
||||
|
||||
int res = trx.begin();
|
||||
|
||||
|
|
|
@ -741,7 +741,7 @@ static void CompactifyDatafiles(
|
|||
size_t const n = toCompact.size();
|
||||
TRI_ASSERT(n > 0);
|
||||
|
||||
arangodb::SingleCollectionTransaction trx(arangodb::StandaloneTransactionContext::Create(document->_vocbase), document->_vocbase,
|
||||
arangodb::SingleCollectionTransaction trx(arangodb::StandaloneTransactionContext::Create(document->_vocbase),
|
||||
document->_info.id(), TRI_TRANSACTION_WRITE);
|
||||
trx.addHint(TRI_TRANSACTION_HINT_NO_BEGIN_MARKER, true);
|
||||
trx.addHint(TRI_TRANSACTION_HINT_NO_ABORT_MARKER, true);
|
||||
|
|
|
@ -2907,7 +2907,7 @@ TRI_document_collection_t* TRI_OpenDocumentCollection(TRI_vocbase_t* vocbase,
|
|||
document->_keyGenerator = keyGenerator;
|
||||
|
||||
arangodb::SingleCollectionTransaction trx(
|
||||
arangodb::StandaloneTransactionContext::Create(vocbase), vocbase,
|
||||
arangodb::StandaloneTransactionContext::Create(vocbase),
|
||||
document->_info.id(), TRI_TRANSACTION_WRITE);
|
||||
|
||||
// build the primary index
|
||||
|
|
|
@ -824,7 +824,7 @@ int CollectorThread::processCollectionOperations(CollectorCache* cache) {
|
|||
|
||||
TRI_DEFER(TRI_ReadUnlockReadWriteLock(&document->_compactionLock));
|
||||
|
||||
arangodb::SingleCollectionTransaction trx(arangodb::StandaloneTransactionContext::Create(document->_vocbase), document->_vocbase,
|
||||
arangodb::SingleCollectionTransaction trx(arangodb::StandaloneTransactionContext::Create(document->_vocbase),
|
||||
document->_info.id(), TRI_TRANSACTION_WRITE);
|
||||
trx.addHint(TRI_TRANSACTION_HINT_NO_USAGE_LOCK,
|
||||
true); // already locked by guard above
|
||||
|
|
|
@ -340,7 +340,7 @@ int RecoverState::executeSingleOperation(
|
|||
res = TRI_ERROR_INTERNAL;
|
||||
|
||||
try {
|
||||
trx = new SingleCollectionTransaction(arangodb::StandaloneTransactionContext::Create(vocbase), vocbase, collectionId, TRI_TRANSACTION_WRITE);
|
||||
trx = new SingleCollectionTransaction(arangodb::StandaloneTransactionContext::Create(vocbase), collectionId, TRI_TRANSACTION_WRITE);
|
||||
|
||||
if (trx == nullptr) {
|
||||
THROW_ARANGO_EXCEPTION(res);
|
||||
|
@ -1393,7 +1393,7 @@ int RecoverState::fillIndexes() {
|
|||
// activate secondary indexes
|
||||
document->useSecondaryIndexes(true);
|
||||
|
||||
arangodb::SingleCollectionTransaction trx(arangodb::StandaloneTransactionContext::Create(collection->_vocbase), collection->_vocbase,
|
||||
arangodb::SingleCollectionTransaction trx(arangodb::StandaloneTransactionContext::Create(collection->_vocbase),
|
||||
document->_info.id(), TRI_TRANSACTION_WRITE);
|
||||
|
||||
int res = TRI_FillIndexesDocumentCollection(&trx, collection, document);
|
||||
|
|
Loading…
Reference in New Issue