MCPcopy
hub / github.com/apache/pouchdb / startTransaction

Function startTransaction

lib/index-browser.js:4971–5005  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

4969 });
4970
4971 function startTransaction() {
4972
4973 var stores = [
4974 DOC_STORE, BY_SEQ_STORE,
4975 ATTACH_STORE,
4976 LOCAL_STORE, ATTACH_AND_SEQ_STORE,
4977 META_STORE
4978 ];
4979 var txnResult = openTransactionSafely(idb, stores, 'readwrite');
4980 if (txnResult.error) {
4981 return callback(txnResult.error);
4982 }
4983 txn = txnResult.txn;
4984 txn.onabort = idbError(callback);
4985 txn.ontimeout = idbError(callback);
4986 txn.oncomplete = complete;
4987 docStore = txn.objectStore(DOC_STORE);
4988 bySeqStore = txn.objectStore(BY_SEQ_STORE);
4989 attachStore = txn.objectStore(ATTACH_STORE);
4990 attachAndSeqStore = txn.objectStore(ATTACH_AND_SEQ_STORE);
4991 metaStore = txn.objectStore(META_STORE);
4992
4993 metaStore.get(META_STORE).onsuccess = function (e) {
4994 metaDoc = e.target.result;
4995 updateDocCountIfReady();
4996 };
4997
4998 verifyAttachments(function (err) {
4999 if (err) {
5000 preconditionErrored = true;
5001 return callback(err);
5002 }
5003 fetchExistingDocs();
5004 });
5005 }
5006
5007 function onAllDocsProcessed() {
5008 allDocsProcessed = true;

Callers 1

idbBulkDocsFunction · 0.70

Calls 6

openTransactionSafelyFunction · 0.70
idbErrorFunction · 0.70
updateDocCountIfReadyFunction · 0.70
verifyAttachmentsFunction · 0.70
fetchExistingDocsFunction · 0.70
getMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…